linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device
@ 2019-07-22 17:26 Wolfram Sang
  2019-07-24 22:47 ` David Miller
  2019-07-25 18:19 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2019-07-22 17:26 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Solarflare linux maintainers, Edward Cree,
	Martin Habets, David S. Miller, netdev, linux-kernel

Move from i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an
ERRPTR which we use in error handling.

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

Only build tested. Part of a tree-wide move to deprecate
i2c_new_dummy().

 drivers/net/ethernet/sfc/falcon/falcon_boards.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/falcon_boards.c b/drivers/net/ethernet/sfc/falcon/falcon_boards.c
index 839189dab98e..189ce9b9dfa7 100644
--- a/drivers/net/ethernet/sfc/falcon/falcon_boards.c
+++ b/drivers/net/ethernet/sfc/falcon/falcon_boards.c
@@ -454,13 +454,13 @@ static int sfe4001_init(struct ef4_nic *efx)
 
 #if IS_ENABLED(CONFIG_SENSORS_LM90)
 	board->hwmon_client =
-		i2c_new_device(&board->i2c_adap, &sfe4001_hwmon_info);
+		i2c_new_client_device(&board->i2c_adap, &sfe4001_hwmon_info);
 #else
 	board->hwmon_client =
-		i2c_new_dummy(&board->i2c_adap, sfe4001_hwmon_info.addr);
+		i2c_new_dummy_device(&board->i2c_adap, sfe4001_hwmon_info.addr);
 #endif
-	if (!board->hwmon_client)
-		return -EIO;
+	if (IS_ERR(board->hwmon_client))
+		return PTR_ERR(board->hwmon_client);
 
 	/* Raise board/PHY high limit from 85 to 90 degrees Celsius */
 	rc = i2c_smbus_write_byte_data(board->hwmon_client,
@@ -468,9 +468,9 @@ static int sfe4001_init(struct ef4_nic *efx)
 	if (rc)
 		goto fail_hwmon;
 
-	board->ioexp_client = i2c_new_dummy(&board->i2c_adap, PCA9539);
-	if (!board->ioexp_client) {
-		rc = -EIO;
+	board->ioexp_client = i2c_new_dummy_device(&board->i2c_adap, PCA9539);
+	if (IS_ERR(board->ioexp_client)) {
+		rc = PTR_ERR(board->ioexp_client);
 		goto fail_hwmon;
 	}
 
-- 
2.20.1


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

* Re: [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device Wolfram Sang
@ 2019-07-24 22:47 ` David Miller
  2019-07-25 12:37   ` Edward Cree
  2019-07-25 18:19 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2019-07-24 22:47 UTC (permalink / raw)
  To: wsa+renesas
  Cc: linux-i2c, linux-net-drivers, ecree, mhabets, netdev, linux-kernel

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Mon, 22 Jul 2019 19:26:35 +0200

> Move from i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an
> ERRPTR which we use in error handling.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Solarflare folks, please review/test.

Thank you.

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

* Re: [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device
  2019-07-24 22:47 ` David Miller
@ 2019-07-25 12:37   ` Edward Cree
  2019-07-25 19:27     ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Edward Cree @ 2019-07-25 12:37 UTC (permalink / raw)
  To: David Miller, wsa+renesas
  Cc: linux-i2c, linux-net-drivers, mhabets, netdev, linux-kernel

On 24/07/2019 23:47, David Miller wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Date: Mon, 22 Jul 2019 19:26:35 +0200
>
>> Move from i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an
>> ERRPTR which we use in error handling.
>>
>> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Subject & description are incomplete, you're also changing i2c_new_device()
 to i2c_new_client_device().
Other than that,
Acked-by: Edward Cree <ecree@solarflare.com>

> Solarflare folks, please review/test.
>
> Thank you.
Falcon isn't likely to get tested by us, I think we only have about three
 of them left in the building, two of which are in display cabinets ;-)
We end-of-lifed this hardware a couple of years ago, maybe it should be
 downgraded from 'supported' to 'odd fixes'.  Or even moved to staging,
 like that qlogic driver recently was.

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

* Re: [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device
  2019-07-22 17:26 [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device Wolfram Sang
  2019-07-24 22:47 ` David Miller
@ 2019-07-25 18:19 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2019-07-25 18:19 UTC (permalink / raw)
  To: wsa+renesas
  Cc: linux-i2c, linux-net-drivers, ecree, mhabets, netdev, linux-kernel

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Mon, 22 Jul 2019 19:26:35 +0200

> Move from i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an
> ERRPTR which we use in error handling.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied.

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

* Re: [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device
  2019-07-25 12:37   ` Edward Cree
@ 2019-07-25 19:27     ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2019-07-25 19:27 UTC (permalink / raw)
  To: Edward Cree
  Cc: David Miller, wsa+renesas, linux-i2c, linux-net-drivers, mhabets,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]


> >> Move from i2c_new_dummy() to i2c_new_dummy_device(). So, we now get an
> >> ERRPTR which we use in error handling.
> >>
> >> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Subject & description are incomplete, you're also changing i2c_new_device()
>  to i2c_new_client_device().

Right, this was an anomaly with this patch to have both code paths
returning an ERRPTR. The big conversion for i2c_new_device will come
later in a seperate series.

> Other than that,
> Acked-by: Edward Cree <ecree@solarflare.com>

Thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-07-25 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 17:26 [PATCH] net: sfc: falcon: convert to i2c_new_dummy_device Wolfram Sang
2019-07-24 22:47 ` David Miller
2019-07-25 12:37   ` Edward Cree
2019-07-25 19:27     ` Wolfram Sang
2019-07-25 18:19 ` David Miller

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).