aboutsummaryrefslogtreecommitdiff
path: root/drivers/leds/leds-bd2802.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds-bd2802.c')
-rw-r--r--drivers/leds/leds-bd2802.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 2db04231a79..6078c15d345 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -678,13 +678,11 @@ static int bd2802_probe(struct i2c_client *client,
int ret, i;
led = devm_kzalloc(&client->dev, sizeof(struct bd2802_led), GFP_KERNEL);
- if (!led) {
- dev_err(&client->dev, "failed to allocate driver data\n");
+ if (!led)
return -ENOMEM;
- }
led->client = client;
- pdata = led->pdata = client->dev.platform_data;
+ pdata = led->pdata = dev_get_platdata(&client->dev);
i2c_set_clientdata(client, led);
/* Configure RESET GPIO (L: RESET, H: RESET cancel) */