[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVSsAtRLob5fLoBMNu-DRXJOaBrEHYEwG5iCA03XR5JSw@mail.gmail.com>
Date: Tue, 12 Apr 2022 09:23:38 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Javier Martinez Canillas <javierm@...hat.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rob Herring <robh@...nel.org>,
DRI Development <dri-devel@...ts.freedesktop.org>,
Neil Armstrong <narmstrong@...libre.com>,
Mark Brown <broonie@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Chen-Yu Tsai <wens@...nel.org>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>
Subject: Re: [PATCH v2 4/5] drm/solomon: Move device info from ssd130x-i2c to
the core driver
Hi Javier,
Thanks for your patch!
On Mon, Apr 11, 2022 at 11:12 PM Javier Martinez Canillas
<javierm@...hat.com> wrote:
> These are declared in the ssd130x-i2c transport driver but the information
> is not I2C specific, and could be used by other SSD130x transport drivers.
>
> Move them to the ssd130x core driver and just set the OF device entries to
> an ID that could be used to lookup the correct device info from an array.
>
> While being there, also move the SSD130X_DATA and SSD130X_COMMAND control
> bytes. Since even though are used by the I2C interface, it could also be
though they are ... they could
> useful for other transport protocols such as SPI.
>
> Suggested-by: Chen-Yu Tsai <wens@...nel.org>
> Signed-off-by: Javier Martinez Canillas <javierm@...hat.com>
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -860,7 +890,14 @@ struct ssd130x_device *ssd130x_probe(struct device *dev, struct regmap *regmap)
>
> ssd130x->dev = dev;
> ssd130x->regmap = regmap;
> - ssd130x->device_info = device_get_match_data(dev);
> +
> + variant = (enum ssd130x_variants)device_get_match_data(dev);
(uintptr_t), to avoid a cast from pointer to integer of different
size warning.
> +
Please drop the blank line.
> + if (variant >= NR_SSD130X_VARIANTS)
> + return ERR_PTR(dev_err_probe(dev, -EINVAL,
> + "Invalid SSD130x variant\n"));
> +
> + ssd130x->device_info = &ssd130x_variants[variant];
>
> if (ssd130x->device_info->page_mode_only)
> ssd130x->page_address_mode = 1;
With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists