Skip to content

Commit 4897899

Browse files
committed
platform/x86: surface3_power: Simplify mshw0011_adp_psr() to one liner
Refactor mshw0011_adp_psr() to be one liner. Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 74bef18 commit 4897899

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/platform/x86/surface3_power.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,7 @@ static int mshw0011_bst(struct mshw0011_data *cdata, struct bst *bst)
295295

296296
static int mshw0011_adp_psr(struct mshw0011_data *cdata)
297297
{
298-
struct i2c_client *client = cdata->adp1;
299-
int ret;
300-
301-
ret = i2c_smbus_read_byte_data(client, MSHW0011_ADP1_REG_PSR);
302-
if (ret < 0)
303-
return ret;
304-
305-
return ret;
298+
return i2c_smbus_read_byte_data(cdata->adp1, MSHW0011_ADP1_REG_PSR);
306299
}
307300

308301
static int mshw0011_isr(struct mshw0011_data *cdata)

0 commit comments

Comments
 (0)