Re: [PATCH v4 05/18] usb: typec: Add device managed typec_switch_register()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 31, 2024 at 09:06:43PM -0700, Stephen Boyd wrote:
> Simplify driver error paths by adding devm_typec_switch_register() which
> will unregister the typec switch when the parent device is unbound.

...

> +struct typec_switch_dev *
> +devm_typec_switch_register(struct device *parent,
> +			   const struct typec_switch_desc *desc)
> +{
> +	int ret;
> +	struct typec_switch_dev *switch_dev;
> +
> +	switch_dev = typec_switch_register(parent ,desc);

Slipped typo, i.e. wrong location of the white space character.

> +	if (IS_ERR(switch_dev))
> +		return switch_dev;
> +
> +	ret = devm_add_action_or_reset(parent, devm_typec_switch_unregister, switch_dev);
> +	if (ret)
> +		return ERR_PTR(ret);
> +
> +	return switch_dev;
> +}

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux