All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Noralf Trønnes" <noralf@tronnes.org>
Subject: Re: [PATCH 2/2] drm/panel: s6e63m0: Switch to DBI abstraction for SPI
Date: Mon, 14 Jun 2021 08:49:59 -0700	[thread overview]
Message-ID: <CAD=FV=U3kjPRuFsDA__vzMTPqnL12e0xG2A_Nb5wB=UxzUgdTg@mail.gmail.com> (raw)
In-Reply-To: <20210611214243.669892-1-linus.walleij@linaro.org>

Hi,

On Fri, Jun 11, 2021 at 2:44 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
>  static int s6e63m0_spi_probe(struct spi_device *spi)
>  {
>         struct device *dev = &spi->dev;
> +       struct mipi_dbi *dbi;
>         int ret;
>
> -       spi->bits_per_word = 9;
> -       /* Preserve e.g. SPI_3WIRE setting */
> -       spi->mode |= SPI_MODE_3;
> -       ret = spi_setup(spi);
> -       if (ret < 0) {
> -               dev_err(dev, "spi setup failed.\n");
> -               return ret;
> -       }
> -       return s6e63m0_probe(dev, s6e63m0_spi_dcs_read, s6e63m0_spi_dcs_write,
> -                            false);
> +       dbi = devm_kzalloc(dev, sizeof(*dbi), GFP_KERNEL);
> +       if (!dbi)
> +               return -ENOMEM;
> +
> +       ret = mipi_dbi_spi_init(spi, dbi, NULL);
> +       if (ret)
> +               return dev_err_probe(dev, ret, "MIPI DBI init failed\n");
> +       /* Register our custom MCS read commands */
> +       dbi->read_commands = s6e63m0_dbi_read_commands;
> +
> +       spi_set_drvdata(spi, dbi);

I _think_ you want to remove the spi_set_drvdata(). It just gets
clobbered by the dev_set_drvdata() in s6e63m0_probe(), right? That's
why you had to add the "void *" data pointer?

Other than that this looks right to my non-expert eyes. ;-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

      parent reply	other threads:[~2021-06-14 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 21:42 [PATCH 2/2] drm/panel: s6e63m0: Switch to DBI abstraction for SPI Linus Walleij
2021-06-14 11:09 ` Noralf Trønnes
2021-06-14 15:49 ` Doug Anderson [this message]

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='CAD=FV=U3kjPRuFsDA__vzMTPqnL12e0xG2A_Nb5wB=UxzUgdTg@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linus.walleij@linaro.org \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /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.