Commit 57d91e03 authored by Paul Cercueil's avatar Paul Cercueil Committed by Pavel Machek
Browse files

leds: max8997: Don't error if there is no pdata



The driver works just fine if no platform data is supplied.

Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent fb0f4051
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -238,11 +238,6 @@ static int max8997_led_probe(struct platform_device *pdev)
	char name[20];
	int ret = 0;

	if (pdata == NULL) {
		dev_err(&pdev->dev, "no platform data\n");
		return -ENODEV;
	}

	led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
	if (led == NULL)
		return -ENOMEM;
@@ -258,7 +253,7 @@ static int max8997_led_probe(struct platform_device *pdev)
	led->iodev = iodev;

	/* initialize mode and brightness according to platform_data */
	if (pdata->led_pdata) {
	if (pdata && pdata->led_pdata) {
		u8 mode = 0, brightness = 0;

		mode = pdata->led_pdata->mode[led->id];