]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
leds: use platform_{get,set}_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Thu, 23 May 2013 10:28:33 +0000 (03:28 -0700)
committerBryan Wu <cooloney@gmail.com>
Thu, 23 May 2013 18:23:29 +0000 (11:23 -0700)
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-88pm860x.c
drivers/leds/leds-sunfire.c
drivers/leds/leds-wm831x-status.c

index f5b9ea31579009f2c745d8678c41b336a038a23b..232b3ce902e55f6d3c7ea696a93808121e304ace 100644 (file)
@@ -204,7 +204,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
                sprintf(data->name, "led1-blue");
                break;
        }
-       dev_set_drvdata(&pdev->dev, data);
+       platform_set_drvdata(pdev, data);
        data->chip = chip;
        data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion;
        data->port = pdev->id;
index 89792990088de247060f7ed868636b414756c92a..388632d23d447130ca3a8368cd48bae9a9b410eb 100644 (file)
@@ -159,14 +159,14 @@ static int sunfire_led_generic_probe(struct platform_device *pdev,
                }
        }
 
-       dev_set_drvdata(&pdev->dev, p);
+       platform_set_drvdata(pdev, p);
 
        return 0;
 }
 
 static int sunfire_led_generic_remove(struct platform_device *pdev)
 {
-       struct sunfire_drvdata *p = dev_get_drvdata(&pdev->dev);
+       struct sunfire_drvdata *p = platform_get_drvdata(pdev);
        int i;
 
        for (i = 0; i < NUM_LEDS_PER_BOARD; i++)
index 6bd5c679d877fd2dcf4e447b781ec6d3363f2546..120815a427014dc80bf5ebb5ccce35c52e4ec46b 100644 (file)
@@ -241,7 +241,7 @@ static int wm831x_status_probe(struct platform_device *pdev)
                               GFP_KERNEL);
        if (!drvdata)
                return -ENOMEM;
-       dev_set_drvdata(&pdev->dev, drvdata);
+       platform_set_drvdata(pdev, drvdata);
 
        drvdata->wm831x = wm831x;
        drvdata->reg = res->start;