Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] leds: is31fl319x: simplify getting the adapter of a client
@ 2019-07-22 18:14 Wolfram Sang
  2019-07-23 19:02 ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2019-07-22 18:14 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Jacek Anaszewski, Pavel Machek, Dan Murphy,
	linux-leds, linux-kernel

We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/leds/leds-is31fl319x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c
index 2d077b8edd0e..ca6634b8683c 100644
--- a/drivers/leds/leds-is31fl319x.c
+++ b/drivers/leds/leds-is31fl319x.c
@@ -333,12 +333,11 @@ static int is31fl319x_probe(struct i2c_client *client,
 {
 	struct is31fl319x_chip *is31;
 	struct device *dev = &client->dev;
-	struct i2c_adapter *adapter = to_i2c_adapter(dev->parent);
 	int err;
 	int i = 0;
 	u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX;
 
-	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
 		return -EIO;
 
 	is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);
-- 
2.20.1


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

* Re: [PATCH] leds: is31fl319x: simplify getting the adapter of a client
  2019-07-22 18:14 [PATCH] leds: is31fl319x: simplify getting the adapter of a client Wolfram Sang
@ 2019-07-23 19:02 ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2019-07-23 19:02 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Pavel Machek, Dan Murphy, linux-leds, linux-kernel

Hi Wolfram,

Thank you for the patch.

On 7/22/19 8:14 PM, Wolfram Sang wrote:
> We have a dedicated pointer for that, so use it. Much easier to read and
> less computation involved.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/leds/leds-is31fl319x.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c
> index 2d077b8edd0e..ca6634b8683c 100644
> --- a/drivers/leds/leds-is31fl319x.c
> +++ b/drivers/leds/leds-is31fl319x.c
> @@ -333,12 +333,11 @@ static int is31fl319x_probe(struct i2c_client *client,
>  {
>  	struct is31fl319x_chip *is31;
>  	struct device *dev = &client->dev;
> -	struct i2c_adapter *adapter = to_i2c_adapter(dev->parent);
>  	int err;
>  	int i = 0;
>  	u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX;
>  
> -	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
> +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
>  		return -EIO;
>  
>  	is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);
> 

Applied.

-- 
Best regards,
Jacek Anaszewski

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 18:14 [PATCH] leds: is31fl319x: simplify getting the adapter of a client Wolfram Sang
2019-07-23 19:02 ` Jacek Anaszewski

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org linux-leds@archiver.kernel.org
	public-inbox-index linux-leds


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/ public-inbox