backlight: use dev_get_platdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 12 Nov 2013 23:09:04 +0000 (15:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 03:09:16 +0000 (12:09 +0900)
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.  This is a cosmetic change to
make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
32 files changed:
drivers/video/backlight/88pm860x_bl.c
drivers/video/backlight/aat2870_bl.c
drivers/video/backlight/adp5520_bl.c
drivers/video/backlight/adp8860_bl.c
drivers/video/backlight/adp8870_bl.c
drivers/video/backlight/ams369fg06.c
drivers/video/backlight/atmel-pwm-bl.c
drivers/video/backlight/bd6107.c
drivers/video/backlight/corgi_lcd.c
drivers/video/backlight/da903x_bl.c
drivers/video/backlight/generic_bl.c
drivers/video/backlight/gpio_backlight.c
drivers/video/backlight/ili9320.c
drivers/video/backlight/kb3886_bl.c
drivers/video/backlight/l4f00242t03.c
drivers/video/backlight/ld9040.c
drivers/video/backlight/lm3533_bl.c
drivers/video/backlight/lm3630a_bl.c
drivers/video/backlight/lm3639_bl.c
drivers/video/backlight/lms283gf05.c
drivers/video/backlight/lms501kf03.c
drivers/video/backlight/lp855x_bl.c
drivers/video/backlight/lv5207lp.c
drivers/video/backlight/omap1_bl.c
drivers/video/backlight/pcf50633-backlight.c
drivers/video/backlight/platform_lcd.c
drivers/video/backlight/pwm_bl.c
drivers/video/backlight/s6e63m0.c
drivers/video/backlight/tdo24m.c
drivers/video/backlight/tosa_bl.c
drivers/video/backlight/tps65217_bl.c
drivers/video/backlight/wm831x_bl.c

index 2cd63507ed74a7ee420f254e8219abe99378ea91..a84a12a6bf918a59f0d2081662b436acd7b96d5b 100644 (file)
@@ -196,7 +196,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev,
 static int pm860x_backlight_probe(struct platform_device *pdev)
 {
        struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
-       struct pm860x_backlight_pdata *pdata = pdev->dev.platform_data;
+       struct pm860x_backlight_pdata *pdata = dev_get_platdata(&pdev->dev);
        struct pm860x_backlight_data *data;
        struct backlight_device *bl;
        struct resource *res;
index c6fc668d623628015c98488b891144074d3b47a2..c68232b8b7de65992d487377dad4ed96d6d48203 100644 (file)
@@ -127,7 +127,7 @@ static const struct backlight_ops aat2870_bl_ops = {
 
 static int aat2870_bl_probe(struct platform_device *pdev)
 {
-       struct aat2870_bl_platform_data *pdata = pdev->dev.platform_data;
+       struct aat2870_bl_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct aat2870_bl_driver_data *aat2870_bl;
        struct backlight_device *bd;
        struct backlight_properties props;
index c84701b7ca6e802d4d45a7271fabe665782d0a38..fe8e3d1c97980c4d5db5f4dd344774576ededa2f 100644 (file)
@@ -297,7 +297,7 @@ static int adp5520_bl_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        data->master = pdev->dev.parent;
-       data->pdata = pdev->dev.platform_data;
+       data->pdata = dev_get_platdata(&pdev->dev);
 
        if (data->pdata  == NULL) {
                dev_err(&pdev->dev, "missing platform data\n");
index 75b10f8761276a889bde8be038e23212f8730eba..2f77f37fac3cacc2662085e0afb1d7ce1f266245 100644 (file)
@@ -216,7 +216,7 @@ static int adp8860_led_setup(struct adp8860_led *led)
 static int adp8860_led_probe(struct i2c_client *client)
 {
        struct adp8860_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct adp8860_bl *data = i2c_get_clientdata(client);
        struct adp8860_led *led, *led_dat;
        struct led_info *cur_led;
@@ -300,7 +300,7 @@ static int adp8860_led_probe(struct i2c_client *client)
 static int adp8860_led_remove(struct i2c_client *client)
 {
        struct adp8860_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct adp8860_bl *data = i2c_get_clientdata(client);
        int i;
 
@@ -658,7 +658,7 @@ static int adp8860_probe(struct i2c_client *client,
        struct backlight_device *bl;
        struct adp8860_bl *data;
        struct adp8860_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct backlight_properties props;
        uint8_t reg_val;
        int ret;
index 90049d7b5c6037adf9edee6992ce606f389f3329..9eee69fea49d219436c0d8b9bb40321dc2d33efb 100644 (file)
@@ -238,7 +238,7 @@ static int adp8870_led_setup(struct adp8870_led *led)
 static int adp8870_led_probe(struct i2c_client *client)
 {
        struct adp8870_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct adp8870_bl *data = i2c_get_clientdata(client);
        struct adp8870_led *led, *led_dat;
        struct led_info *cur_led;
@@ -325,7 +325,7 @@ static int adp8870_led_probe(struct i2c_client *client)
 static int adp8870_led_remove(struct i2c_client *client)
 {
        struct adp8870_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct adp8870_bl *data = i2c_get_clientdata(client);
        int i;
 
@@ -848,7 +848,7 @@ static int adp8870_probe(struct i2c_client *client,
        struct backlight_device *bl;
        struct adp8870_bl *data;
        struct adp8870_backlight_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        uint8_t reg_val;
        int ret;
 
index 319fef6cb4222728489f8a9df2a104655dfa1b13..df5507b2b4921d9d1926f0e6304fff7605255dda 100644 (file)
@@ -471,7 +471,7 @@ static int ams369fg06_probe(struct spi_device *spi)
        lcd->spi = spi;
        lcd->dev = &spi->dev;
 
-       lcd->lcd_pd = spi->dev.platform_data;
+       lcd->lcd_pd = dev_get_platdata(&spi->dev);
        if (!lcd->lcd_pd) {
                dev_err(&spi->dev, "platform data is NULL\n");
                return -EINVAL;
index f7447f7004fb12babc4141d55ee70698806f8a46..c11121e9176b5974645c672f80b3293a22d617dc 100644 (file)
@@ -133,7 +133,7 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
 
        pwmbl->pdev = pdev;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                retval = -ENODEV;
                goto err_free_mem;
index 15e3294b29feb7571558ca3ec8fbe62c71def004..43c434e7dc8651cd152321884bf8154da5d37068 100644 (file)
@@ -128,7 +128,7 @@ static const struct backlight_ops bd6107_backlight_ops = {
 static int bd6107_probe(struct i2c_client *client,
                          const struct i2c_device_id *id)
 {
-       struct bd6107_platform_data *pdata = client->dev.platform_data;
+       struct bd6107_platform_data *pdata = dev_get_platdata(&client->dev);
        struct backlight_device *backlight;
        struct backlight_properties props;
        struct bd6107 *bd;
index c97867a717a7e0f913b01d472c4fbe460df9e9e2..be56cfe038458fe7ab7e728c290a51f664427409 100644 (file)
@@ -533,7 +533,7 @@ static int setup_gpio_backlight(struct corgi_lcd *lcd,
 static int corgi_lcd_probe(struct spi_device *spi)
 {
        struct backlight_properties props;
-       struct corgi_lcd_platform_data *pdata = spi->dev.platform_data;
+       struct corgi_lcd_platform_data *pdata = dev_get_platdata(&spi->dev);
        struct corgi_lcd *lcd;
        int ret = 0;
 
index 67cadd30e2735b3e3d42323a631fa61cf1c9b8a3..bbad5c21ed9e4a5e02e0d7c326d1da34474b35b2 100644 (file)
@@ -109,7 +109,7 @@ static const struct backlight_ops da903x_backlight_ops = {
 
 static int da903x_backlight_probe(struct platform_device *pdev)
 {
-       struct da9034_backlight_pdata *pdata = pdev->dev.platform_data;
+       struct da9034_backlight_pdata *pdata = dev_get_platdata(&pdev->dev);
        struct da903x_backlight_data *data;
        struct backlight_device *bl;
        struct backlight_properties props;
index 19e393b41438f21faf8fe91995a2846e0597ba5b..48fa9146958b27112b67a3a4524061ad031eeec2 100644 (file)
@@ -79,7 +79,7 @@ static const struct backlight_ops genericbl_ops = {
 static int genericbl_probe(struct platform_device *pdev)
 {
        struct backlight_properties props;
-       struct generic_bl_info *machinfo = pdev->dev.platform_data;
+       struct generic_bl_info *machinfo = dev_get_platdata(&pdev->dev);
        const char *name = "generic-bl";
        struct backlight_device *bd;
 
index 5fa217f9f4457232e15d23d27ab06db24b68710c..118da0c6386fe8bd44b25b767668daa9c607633b 100644 (file)
@@ -62,7 +62,8 @@ static const struct backlight_ops gpio_backlight_ops = {
 
 static int gpio_backlight_probe(struct platform_device *pdev)
 {
-       struct gpio_backlight_platform_data *pdata = pdev->dev.platform_data;
+       struct gpio_backlight_platform_data *pdata =
+               dev_get_platdata(&pdev->dev);
        struct backlight_properties props;
        struct backlight_device *bl;
        struct gpio_backlight *gbl;
index f8be90c5dedcbd772f8d0ad3a6c685da8eb6b9b4..4dd43e079a8dd32682ae4cd7326c93e1ec68c5ed 100644 (file)
@@ -198,7 +198,7 @@ static void ili9320_setup_spi(struct ili9320 *ili,
 int ili9320_probe_spi(struct spi_device *spi,
                                struct ili9320_client *client)
 {
-       struct ili9320_platdata *cfg = spi->dev.platform_data;
+       struct ili9320_platdata *cfg = dev_get_platdata(&spi->dev);
        struct device *dev = &spi->dev;
        struct ili9320 *ili;
        struct lcd_device *lcd;
index bca6ccc74dfbdf5b69e577819e5f2a9bd028f4cb..5bacabb233d6c6f31618ba12c531c2e406d7604a 100644 (file)
@@ -141,7 +141,7 @@ static const struct backlight_ops kb3886bl_ops = {
 static int kb3886bl_probe(struct platform_device *pdev)
 {
        struct backlight_properties props;
-       struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data;
+       struct kb3886bl_machinfo *machinfo = dev_get_platdata(&pdev->dev);
 
        bl_machinfo = machinfo;
        if (!machinfo->limit_mask)
index a35a38c709cf03753a717c8be86d14aae982bcc6..923eae2f85f8fbcf6b542c16d9e1f673642274e2 100644 (file)
@@ -48,7 +48,7 @@ static void l4f00242t03_reset(unsigned int gpio)
 
 static void l4f00242t03_lcd_init(struct spi_device *spi)
 {
-       struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
+       struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev);
        struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
        const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) };
        int ret;
@@ -88,7 +88,7 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
 
 static void l4f00242t03_lcd_powerdown(struct spi_device *spi)
 {
-       struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
+       struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev);
        struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
 
        dev_dbg(&spi->dev, "Powering down LCD\n");
@@ -171,7 +171,7 @@ static struct lcd_ops l4f_ops = {
 static int l4f00242t03_probe(struct spi_device *spi)
 {
        struct l4f00242t03_priv *priv;
-       struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
+       struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev);
        int ret;
 
        if (pdata == NULL) {
index 1e0a3093ce5075198f73a17659bc9f6af33621ad..26d5139b069652ab35b69e90b173f51f5f2559b4 100644 (file)
@@ -702,7 +702,7 @@ static int ld9040_probe(struct spi_device *spi)
        lcd->spi = spi;
        lcd->dev = &spi->dev;
 
-       lcd->lcd_pd = spi->dev.platform_data;
+       lcd->lcd_pd = dev_get_platdata(&spi->dev);
        if (!lcd->lcd_pd) {
                dev_err(&spi->dev, "platform data is NULL.\n");
                return -EINVAL;
index 1d1dbfb789e3aed24628126c748074daef596932..93eea65f4cf920f356ad2a565ab27756196fe6b5 100644 (file)
@@ -284,7 +284,7 @@ static int lm3533_bl_probe(struct platform_device *pdev)
        if (!lm3533)
                return -EINVAL;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(&pdev->dev, "no platform data\n");
                return -EINVAL;
index 1128a022e1d3884f300258b03ca1908d7ec52bc9..999075a4886341ad7043a7495916edcaeaa8cc81 100644 (file)
@@ -365,7 +365,7 @@ static const struct regmap_config lm3630a_regmap = {
 static int lm3630a_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
 {
-       struct lm3630a_platform_data *pdata = client->dev.platform_data;
+       struct lm3630a_platform_data *pdata = dev_get_platdata(&client->dev);
        struct lm3630a_chip *pchip;
        int rval;
 
index 6c888e39e4cd9ceb36cdf7b9f73566521a17eaf1..6fd60adf922ede6393bcd153776bfeebebc998af 100644 (file)
@@ -307,7 +307,7 @@ static int lm3639_probe(struct i2c_client *client,
 {
        int ret;
        struct lm3639_chip_data *pchip;
-       struct lm3639_platform_data *pdata = client->dev.platform_data;
+       struct lm3639_platform_data *pdata = dev_get_platdata(&client->dev);
        struct backlight_properties props;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
index 4eec47261cd38adad7a49565e08cafc66fe5bb3b..80b5929d4872fea833919455416d67862ecf245a 100644 (file)
@@ -128,7 +128,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power)
 {
        struct lms283gf05_state *st = lcd_get_data(ld);
        struct spi_device *spi = st->spi;
-       struct lms283gf05_pdata *pdata = spi->dev.platform_data;
+       struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev);
 
        if (power <= FB_BLANK_NORMAL) {
                if (pdata)
@@ -153,7 +153,7 @@ static struct lcd_ops lms_ops = {
 static int lms283gf05_probe(struct spi_device *spi)
 {
        struct lms283gf05_state *st;
-       struct lms283gf05_pdata *pdata = spi->dev.platform_data;
+       struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev);
        struct lcd_device *ld;
        int ret = 0;
 
index cf01b9ac813182e0b250799503d40658ed34890e..ff46e194a117a71fc9179b11c7cf8dee0cdc206d 100644 (file)
@@ -344,7 +344,7 @@ static int lms501kf03_probe(struct spi_device *spi)
        lcd->spi = spi;
        lcd->dev = &spi->dev;
 
-       lcd->lcd_pd = spi->dev.platform_data;
+       lcd->lcd_pd = dev_get_platdata(&spi->dev);
        if (!lcd->lcd_pd) {
                dev_err(&spi->dev, "platform data is NULL\n");
                return -EINVAL;
index c952175d41136770ca484c98f61618a1e346b379..57f005a9b475c419cc6100441168bce6ebcea0da 100644 (file)
@@ -405,7 +405,7 @@ static int lp855x_parse_dt(struct device *dev, struct device_node *node)
 static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
 {
        struct lp855x *lp;
-       struct lp855x_platform_data *pdata = cl->dev.platform_data;
+       struct lp855x_platform_data *pdata = dev_get_platdata(&cl->dev);
        struct device_node *node = cl->dev.of_node;
        int ret;
 
@@ -414,7 +414,7 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
                if (ret < 0)
                        return ret;
 
-               pdata = cl->dev.platform_data;
+               pdata = dev_get_platdata(&cl->dev);
        }
 
        if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
index 498fd73d59b9d801f67942e2be5ca4d572bf487c..8091a28b24051349b28be01126b1aaa823104dcd 100644 (file)
@@ -93,7 +93,7 @@ static const struct backlight_ops lv5207lp_backlight_ops = {
 static int lv5207lp_probe(struct i2c_client *client,
                          const struct i2c_device_id *id)
 {
-       struct lv5207lp_platform_data *pdata = client->dev.platform_data;
+       struct lv5207lp_platform_data *pdata = dev_get_platdata(&client->dev);
        struct backlight_device *backlight;
        struct backlight_properties props;
        struct lv5207lp *lv;
index 812e22e35cabb4c48a9e2a9ff5360a2116c41a61..ac11a4650c19ea92fcfe26d6720fda8d64913fbf 100644 (file)
@@ -133,7 +133,7 @@ static int omapbl_probe(struct platform_device *pdev)
        struct backlight_properties props;
        struct backlight_device *dev;
        struct omap_backlight *bl;
-       struct omap_backlight_config *pdata = pdev->dev.platform_data;
+       struct omap_backlight_config *pdata = dev_get_platdata(&pdev->dev);
 
        if (!pdata)
                return -ENXIO;
index 6ed76be18f1943e55fd7ad405c490a8749833358..b2184cf70b927c105574c9a0316911563141b98b 100644 (file)
@@ -103,7 +103,7 @@ static int pcf50633_bl_probe(struct platform_device *pdev)
 {
        struct pcf50633_bl *pcf_bl;
        struct device *parent = pdev->dev.parent;
-       struct pcf50633_platform_data *pcf50633_data = parent->platform_data;
+       struct pcf50633_platform_data *pcf50633_data = dev_get_platdata(parent);
        struct pcf50633_bl_platform_data *pdata = pcf50633_data->backlight_data;
        struct backlight_properties bl_props;
 
index 05683670670895aeaf061979c776ff3150c1b370..cc0f0675366eb94f5ea6d3f21035e8d624e873ea 100644 (file)
@@ -80,7 +80,7 @@ static int platform_lcd_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        int err;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(dev, "no platform data supplied\n");
                return -EINVAL;
index 1fea627394d7c419107506d2b29d4cd052ea3b59..36db5d98dd2f5e900d9dafe3bd6e0e10b30e082e 100644 (file)
@@ -163,7 +163,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
 
 static int pwm_backlight_probe(struct platform_device *pdev)
 {
-       struct platform_pwm_backlight_data *data = pdev->dev.platform_data;
+       struct platform_pwm_backlight_data *data = dev_get_platdata(&pdev->dev);
        struct platform_pwm_backlight_data defdata;
        struct backlight_properties props;
        struct backlight_device *bl;
index b37bb1854bf45b9cd56d70a6135e9d44422695ac..4e339adc1f57ca99dadf9bdc9a988129fd587309 100644 (file)
@@ -735,7 +735,7 @@ static int s6e63m0_probe(struct spi_device *spi)
        lcd->spi = spi;
        lcd->dev = &spi->dev;
 
-       lcd->lcd_pd = spi->dev.platform_data;
+       lcd->lcd_pd = dev_get_platdata(&spi->dev);
        if (!lcd->lcd_pd) {
                dev_err(&spi->dev, "platform data is NULL.\n");
                return -EINVAL;
index 18cdf466d50a5710ea73e0ae5d7ce34a5d188d83..2ccfa46eee7c14a410c3474e2db63952b88eba8a 100644 (file)
@@ -338,7 +338,7 @@ static int tdo24m_probe(struct spi_device *spi)
        enum tdo24m_model model;
        int err;
 
-       pdata = spi->dev.platform_data;
+       pdata = dev_get_platdata(&spi->dev);
        if (pdata)
                model = pdata->model;
        else
index 9df66ac68b344e46f8b5a9b0de8b532a3c9acb9a..b8db9338cacddcdadc9cd7d2c08364a9604c4bff 100644 (file)
@@ -38,7 +38,7 @@ struct tosa_bl_data {
 
 static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness)
 {
-       struct spi_device *spi = data->i2c->dev.platform_data;
+       struct spi_device *spi = dev_get_platdata(&data->i2c->dev);
 
        i2c_smbus_write_byte_data(data->i2c, DAC_CH1, data->comadj);
 
index 05782312aeb34dbadeca7545ba24c52edcb02f5c..4ea20394e9517fc6c0bc9fb134a9d5d07f1ffc6c 100644 (file)
@@ -287,12 +287,11 @@ static int tps65217_bl_probe(struct platform_device *pdev)
                if (IS_ERR(pdata))
                        return PTR_ERR(pdata);
        } else {
-               if (!pdev->dev.platform_data) {
+               pdata = dev_get_platdata(&pdev->dev);
+               if (!pdata) {
                        dev_err(&pdev->dev, "no platform data provided\n");
                        return -EINVAL;
                }
-
-               pdata = pdev->dev.platform_data;
        }
 
        tps65217_bl = devm_kzalloc(&pdev->dev, sizeof(*tps65217_bl),
index 9e5517a3a52baeea6546e0d24dc4a8ca2e5ef732..2ccf3206e93f34d1b61c477bc3bc895c640f985c 100644 (file)
@@ -123,7 +123,7 @@ static const struct backlight_ops wm831x_backlight_ops = {
 static int wm831x_backlight_probe(struct platform_device *pdev)
 {
        struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
-       struct wm831x_pdata *wm831x_pdata;
+       struct wm831x_pdata *wm831x_pdata = dev_get_platdata(pdev->dev.parent);
        struct wm831x_backlight_pdata *pdata;
        struct wm831x_backlight_data *data;
        struct backlight_device *bl;
@@ -131,12 +131,10 @@ static int wm831x_backlight_probe(struct platform_device *pdev)
        int ret, i, max_isel, isink_reg, dcdc_cfg;
 
        /* We need platform data */
-       if (pdev->dev.parent->platform_data) {
-               wm831x_pdata = pdev->dev.parent->platform_data;
+       if (wm831x_pdata)
                pdata = wm831x_pdata->backlight;
-       } else {
+       else
                pdata = NULL;
-       }
 
        if (!pdata) {
                dev_err(&pdev->dev, "No platform data supplied\n");