Re: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2018-04-21 at 09:50 +0100, Javier Arteaga wrote:
> Allow userspace to use the on-board LEDs as "upboard:<color>:".

> +	struct upboard_led *led = container_of(cdev, struct
> upboard_led, cdev);

#define to_upboard_led(cdev) container_of(cdev, struct upboard_led,
cdev)

... led = to_upboard_led(cdev);

> +	struct upboard_led *led = container_of(cdev, struct
> upboard_led, cdev);

Ditto.

> +static int __init upboard_led_probe(struct platform_device *pdev)

Are you sure about __init here?

> +	struct upboard_led_data * const pdata = pdev-
> >dev.platform_data;

Don't use direct dereference to platform_data.

> +	if (!pdev->dev.parent)
> +		return -EINVAL;
> +
> +	upboard = dev_get_drvdata(pdev->dev.parent);
> +	if (!upboard || !pdata)
> +		return -EINVAL;

Wouldn't be better to supply regmap as part of platform data?
It will allow be flexible of parent device.

> +MODULE_LICENSE("GPL");

License mismatch.

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux