On 17/11/20 6:24 pm, Dan Carpenter wrote: > This test is reversed so the function will return without sending > the APPLESMC_READ_CMD or completing the rest of the function. That is as designed. The routine looks at the busy line and if it's already in the right state then it simply ends. If not then it tries to "re-align" the state machine by sending a new command. > Fixes: 4d64bb4ba5ec ("hwmon: (applesmc) Re-work SMC comms") > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > --- > drivers/hwmon/applesmc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c > index 79b498f816fe..289b39537683 100644 > --- a/drivers/hwmon/applesmc.c > +++ b/drivers/hwmon/applesmc.c > @@ -227,7 +227,7 @@ static int smc_sane(void) > int ret; > > ret = wait_status(0, SMC_STATUS_BUSY); > - if (!ret) > + if (ret) > return ret; > ret = send_command(APPLESMC_READ_CMD); > if (ret) >