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 IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux