/* Add a copy of platform specific data to the platform device's platform_data pointer. The memory associated with the platform data will be freed when the platform device is released.  */
int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size)
/* Add a copy of platform specific data to the platform device's platform_data pointer. The memory associated with the platform data will be freed when the platform device is released.  */
int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size)
{
	void *d = kmemdup(data, size, GFP_KERNEL);
	if (d) {
		pdev->dev.platform_data = d;
		return 0;
	}
	return -ENOMEM;
}