staging: fbtft: use to_platform_device()
authorGeliang Tang <geliangtang@163.com>
Sun, 27 Dec 2015 13:15:46 +0000 (21:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 03:42:23 +0000 (19:42 -0800)
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft_device.c

index 08d0597ced5b6f4cf63379e902eb8d00223c73be..241d7c6bebde82b76d14a755c6921d90f3e811cf 100644 (file)
@@ -1330,7 +1330,7 @@ static void pr_spi_devices(void)
 static int p_device_found(struct device *dev, void *data)
 {
        struct platform_device
-       *pdev = container_of(dev, struct platform_device, dev);
+       *pdev = to_platform_device(dev);
 
        if (strstr(pdev->name, "fb"))
                dev_info(dev, "%s id=%d pdata? %s\n", pdev->name, pdev->id,