mbox series

[00/51] video: fbdev: Convert to platform remove callback returning void

Message ID 20230318235428.272091-1-u.kleine-koenig@pengutronix.de (mailing list archive)
Headers show
Series video: fbdev: Convert to platform remove callback returning void | expand

Message

Uwe Kleine-König March 18, 2023, 11:53 p.m. UTC
Hello,

this series adapts the platform drivers below drivers/video/fbdev to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver core
doesn't (and cannot) cope for errors during remove. The only effect of a
non-zero return value in .remove() is that the driver core emits a warning. The
device is removed anyhow and an early return from .remove() usually yields a
resource leak.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.

The first patch simplifies the remove callback of one driver to obviously
always return zero. After that all drivers are converted trivially to
.remove_new().

Best regards
Uwe

Uwe Kleine-König (51):
  video: fbdev: au1100fb: Drop if with an always false condition
  video: fbdev: arcfb: Convert to platform remove callback returning
    void
  video: fbdev: au1100fb: Convert to platform remove callback returning
    void
  video: fbdev: au1200fb: Convert to platform remove callback returning
    void
  video: fbdev: broadsheetfb: Convert to platform remove callback
    returning void
  video: fbdev: bw2: Convert to platform remove callback returning void
  video: fbdev: cg14: Convert to platform remove callback returning void
  video: fbdev: cg3: Convert to platform remove callback returning void
  video: fbdev: cg6: Convert to platform remove callback returning void
  video: fbdev: clps711x-fb: Convert to platform remove callback
    returning void
  video: fbdev: cobalt_lcdfb: Convert to platform remove callback
    returning void
  video: fbdev: da8xx-fb: Convert to platform remove callback returning
    void
  video: fbdev: efifb: Convert to platform remove callback returning
    void
  video: fbdev: ep93xx-fb: Convert to platform remove callback returning
    void
  video: fbdev: ffb: Convert to platform remove callback returning void
  video: fbdev: fsl-diu-fb: Convert to platform remove callback
    returning void
  video: fbdev: gbefb: Convert to platform remove callback returning
    void
  video: fbdev: goldfishfb: Convert to platform remove callback
    returning void
  video: fbdev: grvga: Convert to platform remove callback returning
    void
  video: fbdev: hecubafb: Convert to platform remove callback returning
    void
  video: fbdev: hgafb: Convert to platform remove callback returning
    void
  video: fbdev: hitfb: Convert to platform remove callback returning
    void
  video: fbdev: imxfb: Convert to platform remove callback returning
    void
  video: fbdev: leo: Convert to platform remove callback returning void
  video: fbdev: mb862xx: Convert to platform remove callback returning
    void
  video: fbdev: metronomefb: Convert to platform remove callback
    returning void
  video: fbdev: mx3fb: Convert to platform remove callback returning
    void
  video: fbdev: ocfb: Convert to platform remove callback returning void
  video: fbdev: offb: Convert to platform remove callback returning void
  video: fbdev: omapfb: Convert to platform remove callback returning
    void
  video: fbdev: p9100: Convert to platform remove callback returning
    void
  video: fbdev: platinumfb: Convert to platform remove callback
    returning void
  video: fbdev: pxa168fb: Convert to platform remove callback returning
    void
  video: fbdev: pxa3xx-gcu: Convert to platform remove callback
    returning void
  video: fbdev: pxafb: Convert to platform remove callback returning
    void
  video: fbdev: s1d13xxxfb: Convert to platform remove callback
    returning void
  video: fbdev: s3c-fb: Convert to platform remove callback returning
    void
  video: fbdev: sh7760fb: Convert to platform remove callback returning
    void
  video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
    returning void
  video: fbdev: simplefb: Convert to platform remove callback returning
    void
  video: fbdev: sm501fb: Convert to platform remove callback returning
    void
  video: fbdev: tcx: Convert to platform remove callback returning void
  video: fbdev: uvesafb: Convert to platform remove callback returning
    void
  video: fbdev: vesafb: Convert to platform remove callback returning
    void
  video: fbdev: vfb: Convert to platform remove callback returning void
  video: fbdev: vga16fb: Convert to platform remove callback returning
    void
  video: fbdev: via: Convert to platform remove callback returning void
  video: fbdev: vt8500lcdfb: Convert to platform remove callback
    returning void
  video: fbdev: wm8505fb: Convert to platform remove callback returning
    void
  video: fbdev: wmt_ge_rops: Convert to platform remove callback
    returning void
  video: fbdev: xilinxfb: Convert to platform remove callback returning
    void

 drivers/video/fbdev/arcfb.c                    |  5 ++---
 drivers/video/fbdev/au1100fb.c                 | 11 +++--------
 drivers/video/fbdev/au1200fb.c                 |  6 ++----
 drivers/video/fbdev/broadsheetfb.c             |  5 ++---
 drivers/video/fbdev/bw2.c                      |  6 ++----
 drivers/video/fbdev/cg14.c                     |  6 ++----
 drivers/video/fbdev/cg3.c                      |  6 ++----
 drivers/video/fbdev/cg6.c                      |  6 ++----
 drivers/video/fbdev/clps711x-fb.c              |  6 ++----
 drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
 drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
 drivers/video/fbdev/efifb.c                    |  6 ++----
 drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
 drivers/video/fbdev/ffb.c                      |  6 ++----
 drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
 drivers/video/fbdev/gbefb.c                    |  6 ++----
 drivers/video/fbdev/goldfishfb.c               |  5 ++---
 drivers/video/fbdev/grvga.c                    |  6 ++----
 drivers/video/fbdev/hecubafb.c                 |  5 ++---
 drivers/video/fbdev/hgafb.c                    |  6 ++----
 drivers/video/fbdev/hitfb.c                    |  6 ++----
 drivers/video/fbdev/imxfb.c                    |  6 ++----
 drivers/video/fbdev/leo.c                      |  6 ++----
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
 drivers/video/fbdev/metronomefb.c              |  5 ++---
 drivers/video/fbdev/mx3fb.c                    |  5 ++---
 drivers/video/fbdev/ocfb.c                     |  6 ++----
 drivers/video/fbdev/offb.c                     |  8 +++-----
 drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
 drivers/video/fbdev/p9100.c                    |  6 ++----
 drivers/video/fbdev/platinumfb.c               |  6 ++----
 drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
 drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
 drivers/video/fbdev/pxafb.c                    |  8 +++-----
 drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
 drivers/video/fbdev/s3c-fb.c                   |  6 ++----
 drivers/video/fbdev/sh7760fb.c                 |  6 ++----
 drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
 drivers/video/fbdev/simplefb.c                 |  6 ++----
 drivers/video/fbdev/sm501fb.c                  |  6 ++----
 drivers/video/fbdev/tcx.c                      |  6 ++----
 drivers/video/fbdev/uvesafb.c                  |  6 ++----
 drivers/video/fbdev/vesafb.c                   |  6 ++----
 drivers/video/fbdev/vfb.c                      |  5 ++---
 drivers/video/fbdev/vga16fb.c                  |  6 ++----
 drivers/video/fbdev/via/via-gpio.c             |  5 ++---
 drivers/video/fbdev/via/via_i2c.c              |  5 ++---
 drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
 drivers/video/fbdev/wm8505fb.c                 |  6 ++----
 drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
 drivers/video/fbdev/xilinxfb.c                 |  6 ++----
 61 files changed, 126 insertions(+), 230 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Comments

Helge Deller March 19, 2023, 6:04 p.m. UTC | #1
Hello Uwe,

On 3/19/23 00:53, Uwe Kleine-König wrote:
> this series adapts the platform drivers below drivers/video/fbdev to use the
> .remove_new() callback. Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver core
> doesn't (and cannot) cope for errors during remove. The only effect of a
> non-zero return value in .remove() is that the driver core emits a warning. The
> device is removed anyhow and an early return from .remove() usually yields a
> resource leak.
>
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
>
> The first patch simplifies the remove callback of one driver to obviously
> always return zero. After that all drivers are converted trivially to
> .remove_new().

Thanks for that patch series. It's a nice cleanup.
I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
I hope that's ok for you.

Regarding the new "remove_new" struct member I'd prefer a better name but don't
have any idea yet...

Helge

>
> Best regards
> Uwe
>
> Uwe Kleine-König (51):
>    video: fbdev: au1100fb: Drop if with an always false condition
>    video: fbdev: arcfb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1100fb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1200fb: Convert to platform remove callback returning
>      void
>    video: fbdev: broadsheetfb: Convert to platform remove callback
>      returning void
>    video: fbdev: bw2: Convert to platform remove callback returning void
>    video: fbdev: cg14: Convert to platform remove callback returning void
>    video: fbdev: cg3: Convert to platform remove callback returning void
>    video: fbdev: cg6: Convert to platform remove callback returning void
>    video: fbdev: clps711x-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: cobalt_lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: da8xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: efifb: Convert to platform remove callback returning
>      void
>    video: fbdev: ep93xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ffb: Convert to platform remove callback returning void
>    video: fbdev: fsl-diu-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: gbefb: Convert to platform remove callback returning
>      void
>    video: fbdev: goldfishfb: Convert to platform remove callback
>      returning void
>    video: fbdev: grvga: Convert to platform remove callback returning
>      void
>    video: fbdev: hecubafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hgafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hitfb: Convert to platform remove callback returning
>      void
>    video: fbdev: imxfb: Convert to platform remove callback returning
>      void
>    video: fbdev: leo: Convert to platform remove callback returning void
>    video: fbdev: mb862xx: Convert to platform remove callback returning
>      void
>    video: fbdev: metronomefb: Convert to platform remove callback
>      returning void
>    video: fbdev: mx3fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ocfb: Convert to platform remove callback returning void
>    video: fbdev: offb: Convert to platform remove callback returning void
>    video: fbdev: omapfb: Convert to platform remove callback returning
>      void
>    video: fbdev: p9100: Convert to platform remove callback returning
>      void
>    video: fbdev: platinumfb: Convert to platform remove callback
>      returning void
>    video: fbdev: pxa168fb: Convert to platform remove callback returning
>      void
>    video: fbdev: pxa3xx-gcu: Convert to platform remove callback
>      returning void
>    video: fbdev: pxafb: Convert to platform remove callback returning
>      void
>    video: fbdev: s1d13xxxfb: Convert to platform remove callback
>      returning void
>    video: fbdev: s3c-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh7760fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
>      returning void
>    video: fbdev: simplefb: Convert to platform remove callback returning
>      void
>    video: fbdev: sm501fb: Convert to platform remove callback returning
>      void
>    video: fbdev: tcx: Convert to platform remove callback returning void
>    video: fbdev: uvesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vfb: Convert to platform remove callback returning void
>    video: fbdev: vga16fb: Convert to platform remove callback returning
>      void
>    video: fbdev: via: Convert to platform remove callback returning void
>    video: fbdev: vt8500lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: wm8505fb: Convert to platform remove callback returning
>      void
>    video: fbdev: wmt_ge_rops: Convert to platform remove callback
>      returning void
>    video: fbdev: xilinxfb: Convert to platform remove callback returning
>      void
>
>   drivers/video/fbdev/arcfb.c                    |  5 ++---
>   drivers/video/fbdev/au1100fb.c                 | 11 +++--------
>   drivers/video/fbdev/au1200fb.c                 |  6 ++----
>   drivers/video/fbdev/broadsheetfb.c             |  5 ++---
>   drivers/video/fbdev/bw2.c                      |  6 ++----
>   drivers/video/fbdev/cg14.c                     |  6 ++----
>   drivers/video/fbdev/cg3.c                      |  6 ++----
>   drivers/video/fbdev/cg6.c                      |  6 ++----
>   drivers/video/fbdev/clps711x-fb.c              |  6 ++----
>   drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
>   drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
>   drivers/video/fbdev/efifb.c                    |  6 ++----
>   drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
>   drivers/video/fbdev/ffb.c                      |  6 ++----
>   drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
>   drivers/video/fbdev/gbefb.c                    |  6 ++----
>   drivers/video/fbdev/goldfishfb.c               |  5 ++---
>   drivers/video/fbdev/grvga.c                    |  6 ++----
>   drivers/video/fbdev/hecubafb.c                 |  5 ++---
>   drivers/video/fbdev/hgafb.c                    |  6 ++----
>   drivers/video/fbdev/hitfb.c                    |  6 ++----
>   drivers/video/fbdev/imxfb.c                    |  6 ++----
>   drivers/video/fbdev/leo.c                      |  6 ++----
>   drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
>   drivers/video/fbdev/metronomefb.c              |  5 ++---
>   drivers/video/fbdev/mx3fb.c                    |  5 ++---
>   drivers/video/fbdev/ocfb.c                     |  6 ++----
>   drivers/video/fbdev/offb.c                     |  8 +++-----
>   drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
>   drivers/video/fbdev/p9100.c                    |  6 ++----
>   drivers/video/fbdev/platinumfb.c               |  6 ++----
>   drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
>   drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
>   drivers/video/fbdev/pxafb.c                    |  8 +++-----
>   drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
>   drivers/video/fbdev/s3c-fb.c                   |  6 ++----
>   drivers/video/fbdev/sh7760fb.c                 |  6 ++----
>   drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
>   drivers/video/fbdev/simplefb.c                 |  6 ++----
>   drivers/video/fbdev/sm501fb.c                  |  6 ++----
>   drivers/video/fbdev/tcx.c                      |  6 ++----
>   drivers/video/fbdev/uvesafb.c                  |  6 ++----
>   drivers/video/fbdev/vesafb.c                   |  6 ++----
>   drivers/video/fbdev/vfb.c                      |  5 ++---
>   drivers/video/fbdev/vga16fb.c                  |  6 ++----
>   drivers/video/fbdev/via/via-gpio.c             |  5 ++---
>   drivers/video/fbdev/via/via_i2c.c              |  5 ++---
>   drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
>   drivers/video/fbdev/wm8505fb.c                 |  6 ++----
>   drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
>   drivers/video/fbdev/xilinxfb.c                 |  6 ++----
>   61 files changed, 126 insertions(+), 230 deletions(-)
>
> base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
Uwe Kleine-König March 19, 2023, 9:08 p.m. UTC | #2
Hello,

[Dropped Bartlomiej Zolnierkiewicz and Michal Januszewski from Cc, their
email addresses bounced]

On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
> Hello Uwe,
> 
> On 3/19/23 00:53, Uwe Kleine-König wrote:
> > this series adapts the platform drivers below drivers/video/fbdev to use the
> > .remove_new() callback. Compared to the traditional .remove() callback
> > .remove_new() returns no value. This is a good thing because the driver core
> > doesn't (and cannot) cope for errors during remove. The only effect of a
> > non-zero return value in .remove() is that the driver core emits a warning. The
> > device is removed anyhow and an early return from .remove() usually yields a
> > resource leak.
> > 
> > By changing the remove callback to return void driver authors cannot
> > reasonably assume any more that there is some kind of cleanup later.
> > 
> > The first patch simplifies the remove callback of one driver to obviously
> > always return zero. After that all drivers are converted trivially to
> > .remove_new().
> 
> Thanks for that patch series. It's a nice cleanup.
> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
> I hope that's ok for you.
> 
> Regarding the new "remove_new" struct member I'd prefer a better name but don't
> have any idea yet...

Ideally we won't have to life with it for long. The eventual plan is to
switch back to "remove" once all drivers are converted. So I didn't
think intensively about a better name. Did you know that struct
i2c_driver has a "temporary" .probe_new() callback since 2016?

Best regards
Uwe
Helge Deller March 19, 2023, 9:41 p.m. UTC | #3
On 3/19/23 22:08, Uwe Kleine-König wrote:
> Hello,
>
> [Dropped Bartlomiej Zolnierkiewicz and Michal Januszewski from Cc, their
> email addresses bounced]
>
> On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
>> Hello Uwe,
>>
>> On 3/19/23 00:53, Uwe Kleine-König wrote:
>>> this series adapts the platform drivers below drivers/video/fbdev to use the
>>> .remove_new() callback. Compared to the traditional .remove() callback
>>> .remove_new() returns no value. This is a good thing because the driver core
>>> doesn't (and cannot) cope for errors during remove. The only effect of a
>>> non-zero return value in .remove() is that the driver core emits a warning. The
>>> device is removed anyhow and an early return from .remove() usually yields a
>>> resource leak.
>>>
>>> By changing the remove callback to return void driver authors cannot
>>> reasonably assume any more that there is some kind of cleanup later.
>>>
>>> The first patch simplifies the remove callback of one driver to obviously
>>> always return zero. After that all drivers are converted trivially to
>>> .remove_new().
>>
>> Thanks for that patch series. It's a nice cleanup.
>> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
>> I hope that's ok for you.
>>
>> Regarding the new "remove_new" struct member I'd prefer a better name but don't
>> have any idea yet...
>
> Ideally we won't have to life with it for long. The eventual plan is to
> switch back to "remove" once all drivers are converted. So I didn't
> think intensively about a better name.

Ok.

> Did you know that struct i2c_driver has a "temporary" .probe_new()
> callback since 2016?
No, I didn't knew.  Nice :-)

Helge
Thomas Zimmermann March 20, 2023, 10:03 a.m. UTC | #4
I'm a bit late, but still

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

for the series. Thanks for this cleanup.

Best regards
Thomas

Am 19.03.23 um 00:53 schrieb Uwe Kleine-König:
> Hello,
> 
> this series adapts the platform drivers below drivers/video/fbdev to use the
> .remove_new() callback. Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver core
> doesn't (and cannot) cope for errors during remove. The only effect of a
> non-zero return value in .remove() is that the driver core emits a warning. The
> device is removed anyhow and an early return from .remove() usually yields a
> resource leak.
> 
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
> 
> The first patch simplifies the remove callback of one driver to obviously
> always return zero. After that all drivers are converted trivially to
> .remove_new().
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (51):
>    video: fbdev: au1100fb: Drop if with an always false condition
>    video: fbdev: arcfb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1100fb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1200fb: Convert to platform remove callback returning
>      void
>    video: fbdev: broadsheetfb: Convert to platform remove callback
>      returning void
>    video: fbdev: bw2: Convert to platform remove callback returning void
>    video: fbdev: cg14: Convert to platform remove callback returning void
>    video: fbdev: cg3: Convert to platform remove callback returning void
>    video: fbdev: cg6: Convert to platform remove callback returning void
>    video: fbdev: clps711x-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: cobalt_lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: da8xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: efifb: Convert to platform remove callback returning
>      void
>    video: fbdev: ep93xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ffb: Convert to platform remove callback returning void
>    video: fbdev: fsl-diu-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: gbefb: Convert to platform remove callback returning
>      void
>    video: fbdev: goldfishfb: Convert to platform remove callback
>      returning void
>    video: fbdev: grvga: Convert to platform remove callback returning
>      void
>    video: fbdev: hecubafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hgafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hitfb: Convert to platform remove callback returning
>      void
>    video: fbdev: imxfb: Convert to platform remove callback returning
>      void
>    video: fbdev: leo: Convert to platform remove callback returning void
>    video: fbdev: mb862xx: Convert to platform remove callback returning
>      void
>    video: fbdev: metronomefb: Convert to platform remove callback
>      returning void
>    video: fbdev: mx3fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ocfb: Convert to platform remove callback returning void
>    video: fbdev: offb: Convert to platform remove callback returning void
>    video: fbdev: omapfb: Convert to platform remove callback returning
>      void
>    video: fbdev: p9100: Convert to platform remove callback returning
>      void
>    video: fbdev: platinumfb: Convert to platform remove callback
>      returning void
>    video: fbdev: pxa168fb: Convert to platform remove callback returning
>      void
>    video: fbdev: pxa3xx-gcu: Convert to platform remove callback
>      returning void
>    video: fbdev: pxafb: Convert to platform remove callback returning
>      void
>    video: fbdev: s1d13xxxfb: Convert to platform remove callback
>      returning void
>    video: fbdev: s3c-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh7760fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
>      returning void
>    video: fbdev: simplefb: Convert to platform remove callback returning
>      void
>    video: fbdev: sm501fb: Convert to platform remove callback returning
>      void
>    video: fbdev: tcx: Convert to platform remove callback returning void
>    video: fbdev: uvesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vfb: Convert to platform remove callback returning void
>    video: fbdev: vga16fb: Convert to platform remove callback returning
>      void
>    video: fbdev: via: Convert to platform remove callback returning void
>    video: fbdev: vt8500lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: wm8505fb: Convert to platform remove callback returning
>      void
>    video: fbdev: wmt_ge_rops: Convert to platform remove callback
>      returning void
>    video: fbdev: xilinxfb: Convert to platform remove callback returning
>      void
> 
>   drivers/video/fbdev/arcfb.c                    |  5 ++---
>   drivers/video/fbdev/au1100fb.c                 | 11 +++--------
>   drivers/video/fbdev/au1200fb.c                 |  6 ++----
>   drivers/video/fbdev/broadsheetfb.c             |  5 ++---
>   drivers/video/fbdev/bw2.c                      |  6 ++----
>   drivers/video/fbdev/cg14.c                     |  6 ++----
>   drivers/video/fbdev/cg3.c                      |  6 ++----
>   drivers/video/fbdev/cg6.c                      |  6 ++----
>   drivers/video/fbdev/clps711x-fb.c              |  6 ++----
>   drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
>   drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
>   drivers/video/fbdev/efifb.c                    |  6 ++----
>   drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
>   drivers/video/fbdev/ffb.c                      |  6 ++----
>   drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
>   drivers/video/fbdev/gbefb.c                    |  6 ++----
>   drivers/video/fbdev/goldfishfb.c               |  5 ++---
>   drivers/video/fbdev/grvga.c                    |  6 ++----
>   drivers/video/fbdev/hecubafb.c                 |  5 ++---
>   drivers/video/fbdev/hgafb.c                    |  6 ++----
>   drivers/video/fbdev/hitfb.c                    |  6 ++----
>   drivers/video/fbdev/imxfb.c                    |  6 ++----
>   drivers/video/fbdev/leo.c                      |  6 ++----
>   drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
>   drivers/video/fbdev/metronomefb.c              |  5 ++---
>   drivers/video/fbdev/mx3fb.c                    |  5 ++---
>   drivers/video/fbdev/ocfb.c                     |  6 ++----
>   drivers/video/fbdev/offb.c                     |  8 +++-----
>   drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
>   drivers/video/fbdev/p9100.c                    |  6 ++----
>   drivers/video/fbdev/platinumfb.c               |  6 ++----
>   drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
>   drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
>   drivers/video/fbdev/pxafb.c                    |  8 +++-----
>   drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
>   drivers/video/fbdev/s3c-fb.c                   |  6 ++----
>   drivers/video/fbdev/sh7760fb.c                 |  6 ++----
>   drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
>   drivers/video/fbdev/simplefb.c                 |  6 ++----
>   drivers/video/fbdev/sm501fb.c                  |  6 ++----
>   drivers/video/fbdev/tcx.c                      |  6 ++----
>   drivers/video/fbdev/uvesafb.c                  |  6 ++----
>   drivers/video/fbdev/vesafb.c                   |  6 ++----
>   drivers/video/fbdev/vfb.c                      |  5 ++---
>   drivers/video/fbdev/vga16fb.c                  |  6 ++----
>   drivers/video/fbdev/via/via-gpio.c             |  5 ++---
>   drivers/video/fbdev/via/via_i2c.c              |  5 ++---
>   drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
>   drivers/video/fbdev/wm8505fb.c                 |  6 ++----
>   drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
>   drivers/video/fbdev/xilinxfb.c                 |  6 ++----
>   61 files changed, 126 insertions(+), 230 deletions(-)
> 
> base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
Uwe Kleine-König May 30, 2023, 2:02 p.m. UTC | #5
[Dropped a few recipents that resulted in bounces before]

Hello,

On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
> On 3/19/23 00:53, Uwe Kleine-König wrote:
> > this series adapts the platform drivers below drivers/video/fbdev to use the
> > .remove_new() callback. Compared to the traditional .remove() callback
> > .remove_new() returns no value. This is a good thing because the driver core
> > doesn't (and cannot) cope for errors during remove. The only effect of a
> > non-zero return value in .remove() is that the driver core emits a warning. The
> > device is removed anyhow and an early return from .remove() usually yields a
> > resource leak.
> > 
> > By changing the remove callback to return void driver authors cannot
> > reasonably assume any more that there is some kind of cleanup later.
> > 
> > The first patch simplifies the remove callback of one driver to obviously
> > always return zero. After that all drivers are converted trivially to
> > .remove_new().
> 
> Thanks for that patch series. It's a nice cleanup.
> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
> I hope that's ok for you.

I found patches #7 up to #51 in next, but the first 6 patches are
missing. I guess this wasn't' done on purpose?

Best regards
Uwe
Helge Deller May 30, 2023, 4:12 p.m. UTC | #6
Hi Uwe,

On 5/30/23 16:02, Uwe Kleine-König wrote:
> On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
>> On 3/19/23 00:53, Uwe Kleine-König wrote:
>>> this series adapts the platform drivers below drivers/video/fbdev to use the
>>> .remove_new() callback. Compared to the traditional .remove() callback
>>> .remove_new() returns no value. This is a good thing because the driver core
>>> doesn't (and cannot) cope for errors during remove. The only effect of a
>>> non-zero return value in .remove() is that the driver core emits a warning. The
>>> device is removed anyhow and an early return from .remove() usually yields a
>>> resource leak.
>>>
>>> By changing the remove callback to return void driver authors cannot
>>> reasonably assume any more that there is some kind of cleanup later.
>>>
>>> The first patch simplifies the remove callback of one driver to obviously
>>> always return zero. After that all drivers are converted trivially to
>>> .remove_new().
>>
>> Thanks for that patch series. It's a nice cleanup.
>> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
>> I hope that's ok for you.
>
> I found patches #7 up to #51 in next, but the first 6 patches are
> missing. I guess this wasn't' done on purpose?

Strange. I don't know why I didn't applied those.

Anyway, I've just added them now:

Applying: video: fbdev: au1100fb: Drop if with an always false condition
Applying: video: fbdev: arcfb: Convert to platform remove callback returning void
Applying: video: fbdev: au1100fb: Convert to platform remove callback returning void
Applying: video: fbdev: au1200fb: Convert to platform remove callback returning void
Applying: video: fbdev: broadsheetfb: Convert to platform remove callback returning void
Applying: video: fbdev: bw2: Convert to platform remove callback returning void

Thanks!
Helge

Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).
Uwe Kleine-König May 30, 2023, 4:27 p.m. UTC | #7
Hello Helge,

On Tue, May 30, 2023 at 06:12:09PM +0200, Helge Deller wrote:
> Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).

We both did some different cleanup, on top of your
87be5a5d9a5c5b00505181eedbee62134f07d11d we could further cleanup doing

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index fb38557a9b63..648d6cac86e8 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -590,7 +590,7 @@ static struct platform_driver au1100fb_driver = {
 	.probe		= au1100fb_drv_probe,
 	.remove_new	= au1100fb_drv_remove,
 	.suspend	= au1100fb_drv_suspend,
-        .resume		= au1100fb_drv_resume,
+	.resume		= au1100fb_drv_resume,
 };
 module_platform_driver(au1100fb_driver);
 
Feel free to squash this into 87be5a5d9a5c5b00505181eedbee62134f07d11d.
If you want to apply it separately, either tell me to post a proper
patch, or apply it under your name with my Suggested-by -- whatever
suits you best.

Best regards
Uwe
Helge Deller May 30, 2023, 4:34 p.m. UTC | #8
On 5/30/23 18:27, Uwe Kleine-König wrote:
> Hello Helge,
>
> On Tue, May 30, 2023 at 06:12:09PM +0200, Helge Deller wrote:
>> Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).
>
> We both did some different cleanup, on top of your
> 87be5a5d9a5c5b00505181eedbee62134f07d11d we could further cleanup doing
>
> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> index fb38557a9b63..648d6cac86e8 100644
> --- a/drivers/video/fbdev/au1100fb.c
> +++ b/drivers/video/fbdev/au1100fb.c
> @@ -590,7 +590,7 @@ static struct platform_driver au1100fb_driver = {
>   	.probe		= au1100fb_drv_probe,
>   	.remove_new	= au1100fb_drv_remove,
>   	.suspend	= au1100fb_drv_suspend,
> -        .resume		= au1100fb_drv_resume,
> +	.resume		= au1100fb_drv_resume,
>   };
>   module_platform_driver(au1100fb_driver);
>
> Feel free to squash this into 87be5a5d9a5c5b00505181eedbee62134f07d11d.
> If you want to apply it separately, either tell me to post a proper
> patch, or apply it under your name with my Suggested-by -- whatever
> suits you best.

I've squashed it into your patch.

Thanks!
Helge