Commit fd27234f authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Thomas Bogendoerfer

MIPS: SGI-IP30: Free some unused memory

platform_device_add_data() duplicates the memory it is passed. So we can
free some memory to save a few bytes that would remain unused otherwise.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 33d70856
...@@ -63,6 +63,8 @@ static void bridge_platform_create(int widget, int masterwid) ...@@ -63,6 +63,8 @@ static void bridge_platform_create(int widget, int masterwid)
} }
platform_device_add_resources(pdev, &w1_res, 1); platform_device_add_resources(pdev, &w1_res, 1);
platform_device_add_data(pdev, wd, sizeof(*wd)); platform_device_add_data(pdev, wd, sizeof(*wd));
/* platform_device_add_data() duplicates the data */
kfree(wd);
platform_device_add(pdev); platform_device_add(pdev);
bd = kzalloc(sizeof(*bd), GFP_KERNEL); bd = kzalloc(sizeof(*bd), GFP_KERNEL);
...@@ -92,6 +94,8 @@ static void bridge_platform_create(int widget, int masterwid) ...@@ -92,6 +94,8 @@ static void bridge_platform_create(int widget, int masterwid)
bd->io_offset = IP30_SWIN_BASE(widget); bd->io_offset = IP30_SWIN_BASE(widget);
platform_device_add_data(pdev, bd, sizeof(*bd)); platform_device_add_data(pdev, bd, sizeof(*bd));
/* platform_device_add_data() duplicates the data */
kfree(bd);
platform_device_add(pdev); platform_device_add(pdev);
pr_info("xtalk:%x bridge widget\n", widget); pr_info("xtalk:%x bridge widget\n", widget);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment