[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3ydPqkxxQCSGGp7@kuha.fi.intel.com>
Date: Tue, 22 Nov 2022 11:58:22 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Prashant Malani <pmalani@...omium.org>
Cc: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
chrome-platform@...ts.linux.dev,
Benson Leung <bleung@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH 1/2] usb: typec: Add helper to get partner device struct
Hi Prashant,
On Mon, Nov 21, 2022 at 08:13:35PM +0000, Prashant Malani wrote:
> +/**
> + * typec_partner_to_dev - Get the device struct of a USB Type-C partner.
> + * @partner: USB Type-C Partner
> + *
> + * Returns a pointer to the device struct or NULL.
> + */
> +struct device *typec_partner_to_dev(struct typec_partner *partner)
> +{
> + return partner ? &partner->dev : NULL;
> +}
> +EXPORT_SYMBOL_GPL(typec_partner_to_dev);
Let's not loose the protection around these devices unless there is no
other way, and in this case there is.
Please just create a wrapper for usb_power_delivery_register() instead:
struct usb_power_delivery *
typec_partner_usb_power_delivery_register(struct typec_partner *partner,
struct usb_power_delivery_desc *desc)
{
return usb_power_delivery_register(&partner->dev, desc);
}
EXPORT_SYMBOL_GPL(typec_partner_usb_power_delivery_register);
thanks,
--
heikki
Powered by blists - more mailing lists