public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* platform_device_add_data(pdev, NULL, 0)
@ 2009-10-23 20:26 Uwe Kleine-König
  2009-10-26 16:48 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2009-10-23 20:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Russell King, Greg Kroah-Hartman, Andrew Morton, Samuel Ortiz,
	Mark Brown

Hello,

mfd_add_device() (defined in drivers/mfd/mfd-core.c) is a wrapper do
allocate platform_devices.

It contains:

	ret = platform_device_add_data(pdev,
			cell->platform_data, cell->data_size);

If cell->data_size is 0 (and so likely cell->platform_data == NULL),
still pdev->dev.platform_data get assigned ZERO_SIZE_PTR.

IMHO the result should better be that pdev->dev.platform_data ends being
NULL, too.  Agreed?

If yes, where is the right place to fix that, mfd_add_device() or
platform_device_add_data()?

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-26 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23 20:26 platform_device_add_data(pdev, NULL, 0) Uwe Kleine-König
2009-10-26 16:48 ` Greg KH
2009-10-26 21:19   ` Uwe Kleine-König
2009-10-26 21:21     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox