From 48978995950b2ebbebdc47623fe55c75f1633e40 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 26 Mar 2020 16:05:56 +0200 Subject: [PATCH] platform/x86: surface3_power: Simplify mshw0011_adp_psr() to one liner Refactor mshw0011_adp_psr() to be one liner. Signed-off-by: Andy Shevchenko --- drivers/platform/x86/surface3_power.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/platform/x86/surface3_power.c b/drivers/platform/x86/surface3_power.c index 3eb1b48c562e..4229e64a84e8 100644 --- a/drivers/platform/x86/surface3_power.c +++ b/drivers/platform/x86/surface3_power.c @@ -295,14 +295,7 @@ static int mshw0011_bst(struct mshw0011_data *cdata, struct bst *bst) static int mshw0011_adp_psr(struct mshw0011_data *cdata) { - struct i2c_client *client = cdata->adp1; - int ret; - - ret = i2c_smbus_read_byte_data(client, MSHW0011_ADP1_REG_PSR); - if (ret < 0) - return ret; - - return ret; + return i2c_smbus_read_byte_data(cdata->adp1, MSHW0011_ADP1_REG_PSR); } static int mshw0011_isr(struct mshw0011_data *cdata)