gpio: use dev_get_platdata()
authorNizam Haider <nizamhaider786@gmail.com>
Mon, 23 Nov 2015 15:23:18 +0000 (20:53 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Nov 2015 15:41:26 +0000 (16:41 +0100)
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-ath79.c
drivers/gpio/gpio-davinci.c
drivers/gpio/gpio-f7188x.c
drivers/gpio/gpio-octeon.c
drivers/gpio/gpio-sch311x.c

index b1410226dc956522ae113c030c83b8584ecc96f2..e7e38af11ec979464afefc20aadcab1f3c5889cf 100644 (file)
@@ -138,7 +138,7 @@ static const struct of_device_id ath79_gpio_of_match[] = {
 
 static int ath79_gpio_probe(struct platform_device *pdev)
 {
-       struct ath79_gpio_platform_data *pdata = pdev->dev.platform_data;
+       struct ath79_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct device_node *np = pdev->dev.of_node;
        struct ath79_gpio_ctrl *ctrl;
        struct resource *res;
index cf31179726b136861ad6ac69b6fb3d33ef2b9518..9fd32f76ffa7c102e4fd6224f60cb336a40eff9f 100644 (file)
@@ -149,7 +149,7 @@ davinci_gpio_get_pdata(struct platform_device *pdev)
        u32 val;
 
        if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node)
-               return pdev->dev.platform_data;
+               return dev_get_platdata(&pdev->dev);
 
        pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
index 1734e4fbd2b501a20a606709ad9d59d2ffb0e84d..2be7337cf4ae255b5e60fee360a6a115378459d7 100644 (file)
@@ -298,7 +298,7 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
 {
        int err;
        int i;
-       struct f7188x_sio *sio = pdev->dev.platform_data;
+       struct f7188x_sio *sio = dev_get_platdata(&pdev->dev);
        struct f7188x_gpio_data *data;
 
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
index 3c66ce4fe9ed0598224e57afdcb43ccbb64791fc..afbb2417dfbca70872889ed61595d0525e935401 100644 (file)
@@ -128,7 +128,7 @@ out:
 
 static int octeon_gpio_remove(struct platform_device *pdev)
 {
-       struct gpio_chip *chip = pdev->dev.platform_data;
+       struct gpio_chip *chip = dev_get_platdata(&pdev->dev);
        gpiochip_remove(chip);
        return 0;
 }
index 3841398d1078864254fa8e5cb47773dd13c3dcbf..b454792de7788c20b42ef331131b00bfe7fd970c 100644 (file)
@@ -229,7 +229,7 @@ static int sch311x_gpio_direction_out(struct gpio_chip *chip, unsigned offset,
 
 static int sch311x_gpio_probe(struct platform_device *pdev)
 {
-       struct sch311x_pdev_data *pdata = pdev->dev.platform_data;
+       struct sch311x_pdev_data *pdata = dev_get_platdata(&pdev->dev);
        struct sch311x_gpio_priv *priv;
        struct sch311x_gpio_block *block;
        int err, i;
@@ -289,7 +289,7 @@ exit_err:
 
 static int sch311x_gpio_remove(struct platform_device *pdev)
 {
-       struct sch311x_pdev_data *pdata = pdev->dev.platform_data;
+       struct sch311x_pdev_data *pdata = dev_get_platdata(&pdev->dev);
        struct sch311x_gpio_priv *priv = platform_get_drvdata(pdev);
        int i;
 
This page took 0.028955 seconds and 5 git commands to generate.