mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 09:01:36 -04:00
platform/chrome: cros_typec_switch: Use PTR_ERR_OR_ZERO() to simplify
Use the standard error pointer macro to shorten the code and simplify. Cc: Prashant Malani <pmalani@chromium.org> Cc: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Acked-by: Prashant Malani <pmalani@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220830225831.2362403-4-swboyd@chromium.org
This commit is contained in:
committed by
Tzung-Bi Shih
parent
bbb5fb85cf
commit
dc22a33e35
@@ -185,10 +185,8 @@ static int cros_typec_register_mode_switch(struct cros_typec_port *port,
|
||||
};
|
||||
|
||||
port->mode_switch = typec_mux_register(port->sdata->dev, &mode_switch_desc);
|
||||
if (IS_ERR(port->mode_switch))
|
||||
return PTR_ERR(port->mode_switch);
|
||||
|
||||
return 0;
|
||||
return PTR_ERR_OR_ZERO(port->mode_switch);
|
||||
}
|
||||
|
||||
static int cros_typec_register_retimer(struct cros_typec_port *port, struct fwnode_handle *fwnode)
|
||||
@@ -201,10 +199,8 @@ static int cros_typec_register_retimer(struct cros_typec_port *port, struct fwno
|
||||
};
|
||||
|
||||
port->retimer = typec_retimer_register(port->sdata->dev, &retimer_desc);
|
||||
if (IS_ERR(port->retimer))
|
||||
return PTR_ERR(port->retimer);
|
||||
|
||||
return 0;
|
||||
return PTR_ERR_OR_ZERO(port->retimer);
|
||||
}
|
||||
|
||||
static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
|
||||
|
||||
Reference in New Issue
Block a user