linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: OMAPDSS: panel-sharp-ls037v7dw01: update to use gpiod
       [not found] <20151224072926.GE29642@mwanda>
@ 2016-01-13 23:22 ` Tony Lindgren
  2016-01-14  7:44   ` Tomi Valkeinen
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2016-01-13 23:22 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Tomi Valkeinen, linux-omap, dri-devel

Hi,

* Dan Carpenter <dan.carpenter@oracle.com> [151223 23:29]:
> [ It's weird that I'm just now getting this warning from 2014...  Oh
> well, looks legit. -dan ]

Sorry for the delay on this one, got distracted few times with
other bugs to deal with. This seems like a valid warning yeah.

Tomi, do we really need two copies of the the same panels
files in kernel?

For example:

$ find . -name panel-sharp-ls037v7dw01.c
./drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
./drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c

> The patch 9522f9fe86f9: "OMAPDSS: panel-sharp-ls037v7dw01: update to
> use gpiod" from Apr 28, 2014, leads to the following static checker
> warning:
> 
> 	drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c:213 sharp_ls_get_gpio()
> 	warn: 'gd' isn't an ERR_PTR
> 
> drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
>    200  static int sharp_ls_get_gpio(struct device *dev, int gpio, unsigned long flags,
>    201                    char *desc, struct gpio_desc **gpiod)
>    202  {
>    203          struct gpio_desc *gd;
>    204          int r;
>    205  
>    206          *gpiod = NULL;
>    207  
>    208          r = devm_gpio_request_one(dev, gpio, flags, desc);
>    209          if (r)
>    210                  return r == -ENOENT ? 0 : r;
>    211  
>    212          gd = gpio_to_desc(gpio);
>    213          if (IS_ERR(gd))
>    214                  return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd);
>                                ^^^^^^^^^^^^^^^^^^^^^^
> gd can be an ERR_PTR if gpio_to_desc is defined out but it's never
> -ENOENT.

Seems like we can just remove the check for -ENOENT here.

Rgards,

Tony
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OMAPDSS: panel-sharp-ls037v7dw01: update to use gpiod
  2016-01-13 23:22 ` OMAPDSS: panel-sharp-ls037v7dw01: update to use gpiod Tony Lindgren
@ 2016-01-14  7:44   ` Tomi Valkeinen
  2016-01-14 16:45     ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Tomi Valkeinen @ 2016-01-14  7:44 UTC (permalink / raw)
  To: Tony Lindgren, Dan Carpenter; +Cc: linux-omap, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2094 bytes --]

Hi Tony,

On 14/01/16 01:22, Tony Lindgren wrote:
> Hi,
> 
> * Dan Carpenter <dan.carpenter@oracle.com> [151223 23:29]:
>> [ It's weird that I'm just now getting this warning from 2014...  Oh
>> well, looks legit. -dan ]
> 
> Sorry for the delay on this one, got distracted few times with
> other bugs to deal with. This seems like a valid warning yeah.
> 
> Tomi, do we really need two copies of the the same panels
> files in kernel?
> 
> For example:
> 
> $ find . -name panel-sharp-ls037v7dw01.c
> ./drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> ./drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c

Strictly no, but I think this is the best way forward. Longer story:
http://comments.gmane.org/gmane.comp.video.dri.devel/143151

>> The patch 9522f9fe86f9: "OMAPDSS: panel-sharp-ls037v7dw01: update to
>> use gpiod" from Apr 28, 2014, leads to the following static checker
>> warning:
>>
>> 	drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c:213 sharp_ls_get_gpio()
>> 	warn: 'gd' isn't an ERR_PTR
>>
>> drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
>>    200  static int sharp_ls_get_gpio(struct device *dev, int gpio, unsigned long flags,
>>    201                    char *desc, struct gpio_desc **gpiod)
>>    202  {
>>    203          struct gpio_desc *gd;
>>    204          int r;
>>    205  
>>    206          *gpiod = NULL;
>>    207  
>>    208          r = devm_gpio_request_one(dev, gpio, flags, desc);
>>    209          if (r)
>>    210                  return r == -ENOENT ? 0 : r;
>>    211  
>>    212          gd = gpio_to_desc(gpio);
>>    213          if (IS_ERR(gd))
>>    214                  return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd);
>>                                ^^^^^^^^^^^^^^^^^^^^^^
>> gd can be an ERR_PTR if gpio_to_desc is defined out but it's never
>> -ENOENT.
> 
> Seems like we can just remove the check for -ENOENT here.

Yep. Writing a patch for this and the other panel-sharp-ls037v7dw01
error Dan reported is on my todo.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OMAPDSS: panel-sharp-ls037v7dw01: update to use gpiod
  2016-01-14  7:44   ` Tomi Valkeinen
@ 2016-01-14 16:45     ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2016-01-14 16:45 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, dri-devel, Dan Carpenter

* Tomi Valkeinen <tomi.valkeinen@ti.com> [160113 23:45]:
> On 14/01/16 01:22, Tony Lindgren wrote:
> > Tomi, do we really need two copies of the the same panels
> > files in kernel?
> > 
> > For example:
> > 
> > $ find . -name panel-sharp-ls037v7dw01.c
> > ./drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> > ./drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c
> 
> Strictly no, but I think this is the best way forward. Longer story:
> http://comments.gmane.org/gmane.comp.video.dri.devel/143151

OK. Something that may help is to move the panels to live under
their control bus (i2c, spi) where they probe and just register
with omapdrm or omapfb.

> > Seems like we can just remove the check for -ENOENT here.
> 
> Yep. Writing a patch for this and the other panel-sharp-ls037v7dw01
> error Dan reported is on my todo.

OK thanks,

Tony

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-14 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20151224072926.GE29642@mwanda>
2016-01-13 23:22 ` OMAPDSS: panel-sharp-ls037v7dw01: update to use gpiod Tony Lindgren
2016-01-14  7:44   ` Tomi Valkeinen
2016-01-14 16:45     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).