diff mbox series

[v2,01/11] power: bq25890: remove redundant I2C bus check

Message ID 1b3c0d2b01c56cfc073f9ff4961f077098edbe67.1588517058.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State Superseded, archived
Headers show
Series power: supply: bq25890: fix and extend | expand

Commit Message

Michał Mirosław May 3, 2020, 3:21 p.m. UTC
regmap initialization will check I2C adapter functionality.
Remove redundant check in the driver.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/power/supply/bq25890_charger.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Sebastian Reichel May 3, 2020, 7:56 p.m. UTC | #1
Hi,

On Sun, May 03, 2020 at 05:21:10PM +0200, Michał Mirosław wrote:
> regmap initialization will check I2C adapter functionality.
> Remove redundant check in the driver.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/bq25890_charger.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index aebd1253dbc9..c642519ef7b2 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -881,17 +881,11 @@ static int bq25890_fw_probe(struct bq25890_device *bq)
>  static int bq25890_probe(struct i2c_client *client,
>  			 const struct i2c_device_id *id)
>  {
> -	struct i2c_adapter *adapter = client->adapter;
>  	struct device *dev = &client->dev;
>  	struct bq25890_device *bq;
>  	int ret;
>  	int i;
>  
> -	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
> -		dev_err(dev, "No support for SMBUS_BYTE_DATA\n");
> -		return -ENODEV;
> -	}
> -
>  	bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL);
>  	if (!bq)
>  		return -ENOMEM;
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index aebd1253dbc9..c642519ef7b2 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -881,17 +881,11 @@  static int bq25890_fw_probe(struct bq25890_device *bq)
 static int bq25890_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
-	struct i2c_adapter *adapter = client->adapter;
 	struct device *dev = &client->dev;
 	struct bq25890_device *bq;
 	int ret;
 	int i;
 
-	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
-		dev_err(dev, "No support for SMBUS_BYTE_DATA\n");
-		return -ENODEV;
-	}
-
 	bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL);
 	if (!bq)
 		return -ENOMEM;