All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	David Lechner <david@lechnology.com>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	David Lechner <david@lechnology.com>
Subject: Re: [PATCH v2 1/4] drm/tiny/repaper: Make driver OF-independent
Date: Wed, 5 Feb 2020 22:31:03 +0100	[thread overview]
Message-ID: <20200205213103.GA14713@ravnborg.org> (raw)
In-Reply-To: <20200131204923.48928-1-andriy.shevchenko@linux.intel.com>

Hi David.

Are you planning to pick this series and apply it?
Unless I get any other info I plan to process it tomorrow.

	Sam

On Fri, Jan 31, 2020 at 10:49:22PM +0200, Andy Shevchenko wrote:
> There is one OF call in the driver that limits its area of use.
> Replace it to generic device_get_match_data() and get rid of OF dependency.
> 
> While here, cast SPI driver data to certain enumerator type.
> 
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: dri-devel@lists.freedesktop.org
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: David Lechner <david@lechnology.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> v2: Replace cryptic macro with comment, add Rb tag (Sam)
>  drivers/gpu/drm/tiny/repaper.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
> index 76d179200775..e52a19ffd7c0 100644
> --- a/drivers/gpu/drm/tiny/repaper.c
> +++ b/drivers/gpu/drm/tiny/repaper.c
> @@ -17,7 +17,7 @@
>  #include <linux/dma-buf.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/property.h>
>  #include <linux/sched/clock.h>
>  #include <linux/spi/spi.h>
>  #include <linux/thermal.h>
> @@ -40,6 +40,7 @@
>  #define REPAPER_RID_G2_COG_ID	0x12
>  
>  enum repaper_model {
> +	/* 0 is reserved to avoid clashing with NULL */
>  	E1144CS021 = 1,
>  	E1190CS021,
>  	E2200CS021,
> @@ -995,21 +996,21 @@ static int repaper_probe(struct spi_device *spi)
>  {
>  	const struct drm_display_mode *mode;
>  	const struct spi_device_id *spi_id;
> -	const struct of_device_id *match;
>  	struct device *dev = &spi->dev;
>  	enum repaper_model model;
>  	const char *thermal_zone;
>  	struct repaper_epd *epd;
>  	size_t line_buffer_size;
>  	struct drm_device *drm;
> +	const void *match;
>  	int ret;
>  
> -	match = of_match_device(repaper_of_match, dev);
> +	match = device_get_match_data(dev);
>  	if (match) {
> -		model = (enum repaper_model)match->data;
> +		model = (enum repaper_model)match;
>  	} else {
>  		spi_id = spi_get_device_id(spi);
> -		model = spi_id->driver_data;
> +		model = (enum repaper_model)spi_id->driver_data;
>  	}
>  
>  	/* The SPI device is used to allocate dma memory */
> -- 
> 2.24.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-05 21:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 20:49 [PATCH v2 1/4] drm/tiny/repaper: Make driver OF-independent Andy Shevchenko
2020-01-31 20:49 ` [PATCH v2 2/4] drm/tiny/repaper: No need to set ->owner for spi_register_driver() Andy Shevchenko
2020-01-31 20:49 ` [PATCH v2 3/4] drm/tiny/st7735r: Make driver OF-independent Andy Shevchenko
2020-01-31 20:49 ` [PATCH v2 4/4] drm/tiny/st7735r: No need to set ->owner for spi_register_driver() Andy Shevchenko
2020-02-05 21:31 ` Sam Ravnborg [this message]
2020-02-05 22:12   ` [PATCH v2 1/4] drm/tiny/repaper: Make driver OF-independent David Lechner
2020-02-10  1:56 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200205213103.GA14713@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.