# \[PATCH 0/6\] remove deprecated i2c\_new\_device API

- Subsystems: FRAMEBUFFER LAYER, BACKLIGHT CLASS/SUBSYSTEM, DRM DRIVERS, DRM DRIVERS AND MISC GPU PATCHES, I2C SUBSYSTEM, INTEL MID (Mobile Internet Device) PLATFORM, MEDIA INPUT INFRASTRUCTURE (V4L/DVB), THE REST, X86 ARCHITECTURE (32-BIT AND 64-BIT)
- Maintainers: Helge Deller, Lee Jones, Daniel Thompson, Jingoo Han, David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Andi Shyti, Andy Shevchenko, Mauro Carvalho Chehab, Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen
- Series: 6 patches touching 7 files, +14/-46
- Status: PENDING · 4 of 6 reviewed
- Pending, 4 of 6 reviewed.
- List: linux-fbdev
- 6 messages, 4 authors
- Page: https://ratatoskr.run/linux-fbdev/2020/06/5998957/t

## \[PATCH 0/6\] remove deprecated i2c\_new\_device API

- From: Wolfram Sang \<wsa+renesas@sang-engineering.com\>
- Date: 2020-06-15 07:58:37 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/5998957.md

```text
I want to remove the above API this cycle, and just a few patches have
not made it into 5.8-rc1. They have been reviewed and most had been
promised to get into linux-next, but well, things happen. So, I hope it
is okay for everyone to collect them like this and push them via I2C for
5.8-rc2.

One minor exception is the media documentation patch which I simply have
missed so far, but it is trivial.

And then, finally, there is the removal of the old API as the final
patch. Phew, that's been a long ride.

I am open for comments, of course.

Happy hacking,

   Wolfram


Wolfram Sang (6):
  drm: encoder_slave: fix refcouting error for modules
  drm: encoder_slave: use new I2C API
  x86/platform/intel-mid: convert to use i2c_new_client_device()
  video: backlight: tosa_lcd: convert to use i2c_new_client_device()
  Documentation: media: convert to use i2c_new_client_device()
  i2c: remove deprecated i2c_new_device API

 .../driver-api/media/v4l2-subdev.rst          |  2 +-
 .../userspace-api/media/conf_nitpick.py       |  2 +-
 arch/x86/platform/intel-mid/sfi.c             |  4 +--
 drivers/gpu/drm/drm_encoder_slave.c           | 15 ++++-------
 drivers/i2c/i2c-core-base.c                   | 25 -------------------
 drivers/video/backlight/tosa_lcd.c            |  4 +--
 include/linux/i2c.h                           |  8 +++---
 7 files changed, 14 insertions(+), 46 deletions(-)

-- 
2.27.0
```

## \[PATCH 4/6\] video: backlight: tosa\_lcd: convert to use i2c\_new\_client\_device()

- From: Wolfram Sang \<wsa+renesas@sang-engineering.com\>
- Date: 2020-06-15 07:58:48 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/5998961.md

```text
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Daniel Thompson <redacted>
---

I'd like to push it via I2C for 5.8-rc2.

 drivers/video/backlight/tosa_lcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c
index e8ab583e5098..113116d3585c 100644
--- a/drivers/video/backlight/tosa_lcd.c
+++ b/drivers/video/backlight/tosa_lcd.c
@@ -107,7 +107,7 @@ static void tosa_lcd_tg_on(struct tosa_lcd_data *data)
 	/* TG LCD GVSS */
 	tosa_tg_send(spi, TG_PINICTL, 0x0);
 
-	if (!data->i2c) {
+	if (IS_ERR_OR_NULL(data->i2c)) {
 		/*
 		 * after the pannel is powered up the first time,
 		 * we can access the i2c bus so probe for the DAC
@@ -119,7 +119,7 @@ static void tosa_lcd_tg_on(struct tosa_lcd_data *data)
 			.addr	= DAC_BASE,
 			.platform_data = data->spi,
 		};
-		data->i2c = i2c_new_device(adap, &info);
+		data->i2c = i2c_new_client_device(adap, &info);
 	}
 }
 
-- 
2.27.0
```

## Re: \[PATCH 0/6\] remove deprecated i2c\_new\_device API

- From: Daniel Vetter \<hidden\>
- Date: 2020-06-16 12:12:52 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/6000576.md

```text
On Mon, Jun 15, 2020 at 09:58:09AM +0200, Wolfram Sang wrote:
> I want to remove the above API this cycle, and just a few patches have
> not made it into 5.8-rc1. They have been reviewed and most had been
> promised to get into linux-next, but well, things happen. So, I hope it
> is okay for everyone to collect them like this and push them via I2C for
> 5.8-rc2.

for the drm side of things:

Acked-by: Daniel Vetter <redacted>
> 
> One minor exception is the media documentation patch which I simply have
> missed so far, but it is trivial.
> 
> And then, finally, there is the removal of the old API as the final
> patch. Phew, that's been a long ride.
> 
> I am open for comments, of course.
> 
> Happy hacking,
> 
>    Wolfram
> 
> 
> Wolfram Sang (6):
>   drm: encoder_slave: fix refcouting error for modules
>   drm: encoder_slave: use new I2C API
>   x86/platform/intel-mid: convert to use i2c_new_client_device()
>   video: backlight: tosa_lcd: convert to use i2c_new_client_device()
>   Documentation: media: convert to use i2c_new_client_device()
>   i2c: remove deprecated i2c_new_device API
> 
>  .../driver-api/media/v4l2-subdev.rst          |  2 +-
>  .../userspace-api/media/conf_nitpick.py       |  2 +-
>  arch/x86/platform/intel-mid/sfi.c             |  4 +--
>  drivers/gpu/drm/drm_encoder_slave.c           | 15 ++++-------
>  drivers/i2c/i2c-core-base.c                   | 25 -------------------
>  drivers/video/backlight/tosa_lcd.c            |  4 +--
>  include/linux/i2c.h                           |  8 +++---
>  7 files changed, 14 insertions(+), 46 deletions(-)
> 
> -- 
> 2.27.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
```

## Re: \[PATCH 0/6\] remove deprecated i2c\_new\_device API

- From: Emil Velikov \<hidden\>
- Date: 2020-06-16 14:09:48 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/6000752.md

```text
Hi all,

On Tue, 16 Jun 2020 at 13:12, Daniel Vetter [ref] wrote:
>
> On Mon, Jun 15, 2020 at 09:58:09AM +0200, Wolfram Sang wrote:
> > I want to remove the above API this cycle, and just a few patches have
> > not made it into 5.8-rc1. They have been reviewed and most had been
> > promised to get into linux-next, but well, things happen. So, I hope it
> > is okay for everyone to collect them like this and push them via I2C for
> > 5.8-rc2.
>
> for the drm side of things:
>
> Acked-by: Daniel Vetter <redacted>
> >
> > One minor exception is the media documentation patch which I simply have
> > missed so far, but it is trivial.
> >
> > And then, finally, there is the removal of the old API as the final
> > patch. Phew, that's been a long ride.
> >
> > I am open for comments, of course.
> >
> > Happy hacking,
> >
> >    Wolfram
> >
> >
> > Wolfram Sang (6):
> >   drm: encoder_slave: fix refcouting error for modules
> >   drm: encoder_slave: use new I2C API

The first two are in drm-misc-next and are to be expected with the 5.9
merge window. As long as that doesn't cause major nuisance proceed as
you prefer.

-Emil
```

## Re: \[PATCH 4/6\] video: backlight: tosa\_lcd: convert to use i2c\_new\_client\_device()

- From: Lee Jones \<hidden\>
- Date: 2020-06-18 08:43:31 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/6004372.md

```text
On Mon, 15 Jun 2020, Wolfram Sang wrote:

> Move away from the deprecated API and return the shiny new ERRPTR where
> useful.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Daniel Thompson <redacted>
> ---
> 
> I'd like to push it via I2C for 5.8-rc2.

Go for it:

Acked-by: Lee Jones <redacted>

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
```

## Re: \[PATCH 0/6\] remove deprecated i2c\_new\_device API

- From: Wolfram Sang \<wsa+renesas@sang-engineering.com\>
- Date: 2020-06-19 07:21:26 
- Message: https://ratatoskr.run/linux-fbdev/2020/06/6005515.md

```text
On Mon, Jun 15, 2020 at 09:58:09AM +0200, Wolfram Sang wrote:
> I want to remove the above API this cycle, and just a few patches have
> not made it into 5.8-rc1. They have been reviewed and most had been
> promised to get into linux-next, but well, things happen. So, I hope it
> is okay for everyone to collect them like this and push them via I2C for
> 5.8-rc2.
> 
> One minor exception is the media documentation patch which I simply have
> missed so far, but it is trivial.
> 
> And then, finally, there is the removal of the old API as the final
> patch. Phew, that's been a long ride.
> 
> I am open for comments, of course.

Applied to for-current, thanks!

```
