[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210128095908.nm5kh4yspza2v27q@kari-VirtualBox>
Date: Thu, 28 Jan 2021 11:59:08 +0200
From: Kari Argillander <kari.argillander@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: carlis <zhangxuezhi3@...il.com>,
Greg KH <gregkh@...uxfoundation.org>,
Colin King <colin.king@...onical.com>,
oliver.graute@...oconnector.com, zhangxuezhi1@...ong.com,
mh12gx2825@...il.com, Stefano Brivio <sbrivio@...hat.com>,
DRI Development <dri-devel@...ts.freedesktop.org>,
Linux Fbdev development list <linux-fbdev@...r.kernel.org>,
driverdevel <devel@...verdev.osuosl.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect
On Thu, Jan 28, 2021 at 10:42:54AM +0100, Geert Uytterhoeven wrote:
> Hi Kari,
>
> On Thu, Jan 28, 2021 at 7:53 AM Kari Argillander
> <kari.argillander@...il.com> wrote:
> > On Thu, Jan 28, 2021 at 09:42:58AM +0800, carlis wrote:
> > > On Thu, 28 Jan 2021 00:32:22 +0200
> > > Kari Argillander <kari.argillander@...il.com> wrote:
> > > > > @@ -82,6 +111,33 @@ enum st7789v_command {
> > > > > */
> > > > > static int init_display(struct fbtft_par *par)
> > > > > {
> > > > > + int rc;
> > > > > + struct device *dev = par->info->device;
> > > > > +
> > > > > + par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0,
> > > > > GPIOD_IN);
> > > > > + if (IS_ERR(par->gpio.te)) {
> > > > > + rc = PTR_ERR(par->gpio.te);
> > > > > + dev_err(par->info->device, "Failed to request te
> > > > > gpio: %d\n", rc);
> > > > > + return rc;
> > > > > + }
> > > >
> > > > You request with optinal and you still want to error out? We could
> > > > just continue and not care about that error. User will be happier if
> > > > device still works somehow.
>
> devm_gpiod_get_index_optional() returns NULL, not an error, if the
> GPIO is not found. So if IS_ERR() is the right check.
>
> And checks for -EPROBE_DEFER can be handled automatically
> by using dev_err_probe() instead of dev_err().
Yeah. Thanks for pointing that clearly.
> > > You mean i just delete this dev_err print ?!
> > > like this:
> > > par->gpio.te = devm_gpiod_get_index_optional(dev, "te",
> > > 0,GPIOD_IN);
> > > if (IS_ERR(par->gpio.te))
> > > return PTR_ERR(par->gpio.te);
> >
> > Not exactly. I'm suggesting something like this.
> >
> > if (IS_ERR(par->gpio.te) == -EPROBE_DEFER) {
> > return -EPROBE_DEFER;
> >
> > if (IS_ERR(par->gpio.te))
> > par-gpio.te = NULL;
> >
> > This like beginning of your patch series but the difference is that if
> > EPROBE_DEFER then we will try again later. Any other error and we will
> > just ignore TE gpio. But this is up to you what you want to do. To me
> > this just seems place where this kind of logic can work.
Powered by blists - more mailing lists