Re: [PATCH v7 2/7] mux: Add helper functions for getting optional and selected mux-state
From: Josua Mayer
Date: Tue Feb 03 2026 - 10:31:27 EST
On 03/02/2026 17:05, Dan Carpenter wrote:
> Sorry about that, I just looked at the implementation in linux-next and
> didn't read the code from the patch too closely.
:)
>
> On Wed, Jan 28, 2026 at 04:46:10PM +0200, Josua Mayer wrote:
>> +/**
>> + * mux_control_get_optional() - Get the optional mux-control for a device.
>> + * @dev: The device that needs a mux-control.
>> + * @mux_name: The name identifying the mux-control.
>> + *
>> + * Return: A pointer to the mux-control, an ERR_PTR with a negative errno.
> I wish the documentation for these "optional" said it could return NULL.
Same. I fixed that for v8 on most functions, but missed one .... .
>
>> + */
>> +struct mux_control *mux_control_get_optional(struct device *dev, const char *mux_name)
>> +{
>> + return mux_get(dev, mux_name, NULL, true);
>> +}
>> +EXPORT_SYMBOL_GPL(mux_control_get_optional);
>> +