[PATCH 2/9] firmware: meson: simplify getting .driver_data
Neil Armstrong
narmstrong at baylibre.com
Mon Sep 20 05:22:40 PDT 2021
On 20/09/2021 11:05, Wolfram Sang wrote:
> We should get 'driver_data' from 'struct device' directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas at sang-engineering.com>
> ---
>
> Build tested only. buildbot is happy.
>
> drivers/firmware/meson/meson_sm.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
> index 77aa5c6398aa..714016e3aab3 100644
> --- a/drivers/firmware/meson/meson_sm.c
> +++ b/drivers/firmware/meson/meson_sm.c
> @@ -240,12 +240,11 @@ EXPORT_SYMBOL_GPL(meson_sm_get);
> static ssize_t serial_show(struct device *dev, struct device_attribute *attr,
> char *buf)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> struct meson_sm_firmware *fw;
> uint8_t *id_buf;
> int ret;
>
> - fw = platform_get_drvdata(pdev);
> + fw = dev_get_drvdata(dev);
>
> id_buf = kmalloc(SM_CHIP_ID_LENGTH, GFP_KERNEL);
> if (!id_buf)
>
Reviewed-by: Neil Armstrong <narmstrong at baylibre.com>
More information about the linux-arm-kernel
mailing list