Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751367AbdGQIU2 (ORCPT ); Mon, 17 Jul 2017 04:20:28 -0400 Received: from mail-he1eur01on0132.outbound.protection.outlook.com ([104.47.0.132]:59904 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751276AbdGQIUX (ORCPT ); Mon, 17 Jul 2017 04:20:23 -0400 Authentication-Results: pengutronix.de; dkim=none (message not signed) header.d=none;pengutronix.de; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH v2 1/3] mux: Add mux_control_get_optional() API To: Stephen Boyd Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.infradead.org, Rob Herring , Rob Clark , Peter Chen , Andy Gross , Jonathan Cameron , Philipp Zabel References: <20170714214005.14967-1-stephen.boyd@linaro.org> <20170714214005.14967-2-stephen.boyd@linaro.org> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Mon, 17 Jul 2017 10:20:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170714214005.14967-2-stephen.boyd@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: DB6P190CA0033.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:2f::46) To VI1PR0202MB2557.eurprd02.prod.outlook.com (2603:10a6:801:6::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddc6cb89-a6df-40e7-0e9f-08d4cceca9ce X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0202MB2557; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2557;3:GzyS6XXuEot0RrogSvJIzRsAMX4SuNlDAfiFVDg6YGQRoH61Mdqn7c6BmUkXuZu/YIabWTbcVfNlvXuqGbAD9btb7QLdMoIa/GziWR+RVR8/4kvKUZcd/LVGFk2X9Ns1TwyzhzJgsnY7aRSkVQ41hmSR3AwJV58tEtOj2ncmRhDJn7wCfU7fKfc92RMl1afArI1az1q5idLHQO4g2r4vfZCTQMQCRzmfpTHjoG7hunjGblj/p2Py3pfy6O592+Uz69/eYFyXVQYQbN0QFfav/DqrMcN6ClQthInbHf5Bv/pqQPINSQa8VTrGTSXUTPLDY7w2PY3USAAbyava4AfmUOO+dA0e9i0K1uefTZnQbPaTlkY0TaZVACfillTxEmwUpo0tkgS1i24a/0vZrofNrtJ0jUZ/jjDuWsgyc+/fK9un/2DNjN7DXcT64rVPWQDkde+rtXPpXcFVvdieBbznkj+jaSGa2BnxYHFRqw/zt9KMiYfImOxoR8rfQJmbxFp04mugctT3B7+VfNn4gzpyXs6qFJQgYAkPsVW57g2TT7iIe05HqRwn43wcWNC7Pm6hiFbByl8CSPN5HBtoEKTg0u6N5R7+nz5jd87R1AwG4mBGPZacDSWfb4wSs4rWoOzCtH3lRZkWRMczYtpnCVtq2wub4oNcdb0aR10bF6j5ar4M8+DrtgYXZdU+MIjQbSkTpWltGuRrGPELIDYHdkfVVg== X-MS-TrafficTypeDiagnostic: VI1PR0202MB2557: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2557;25:aoXvl8Ib5sg9OVS7KcolRmjRfqGK5fls7LliG08aw2fvqMTIu3v5szZk6ncqlOjFjClnEUvzCxuawgPArWxFPtMgc96jUNz8aw/cRIsH2xf2hN+6M6q5GtZ97ut4QQqUIjiqtv2ideG/UaUhSDj2hq696zYMKqMMnkX46ez73NeNYy+k4E753thBtJyVIsCiW1Cysun4z67Bn8tUk3GiECOR8a5Tb9/WXIF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ALQYQPXPpUUYfnbHgZiD1ng+TySPwAx5p7gwp/uU+ldyrk8zJzxGi9OyvrQslZCApmL01Pyby7T0hTuuD1z9wTQmRb+CDiwhFdkQudLw9lC4OZiilwH1np8xIQLChPxDlK8tidlJoOw7RbmS31XF4RlIQ1Bm6Bzlfn4Rzm75CnJZmOgq0l4AL1Yv19fHYVzYUJAGsuge8sb77wGd6wnlcezf5l426UwORXDF+3Y1pYeqvYaWBTfQ/U8C+9OIKaxX8DPL2yBLFKrj7OreFubXQGMOXGpngJSRMeMlfDPfn95gp55Tn9oqgIs/dD1VMtNpIKUC+7ne8/nmtS0PwUYFnghi08Pp3KFN9xYghnaW7ezqrw0qDU+MVniHG49PuSOwUZtCad5guQPqwk9Baa1A7pF/Q== X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(247924648384137); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(2016111802025)(20161123555025)(20161123558100)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0202MB2557;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0202MB2557; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTc7NDo5Zi9WRlRJelA0cDZHVFN4TVJoR3dsM0JZ?= =?utf-8?B?ZHdqN2pWTXk3Q1lJTHJWR3JGSkFEc3RiN0VCWUc1bkZuRVQ3QlBDYmJtQVNP?= =?utf-8?B?a0JlenU0MnkvTzJCNzZvUE1Yajg1NjVzND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gwcmNobkFET2d0MW9WWVhlT3EwUUdXdDg2NGFnZUZt?= =?utf-8?B?bkVSZGdjd1ZkVWFnUUpQQjdtdUFPNUY1QUgxelFzZ3paeG9tNzBSUVdoNkEv?= =?utf-8?B?SnowZGJQUTVlY0lRWkpQK2VsdzY1OW51eDM1b3FrV2ZJa0JNU2ovMXRhS2NC?= =?utf-8?B?ZWE2Q1MrVmhZeVFjV2w5OE8vKzA2MkdiT1Z4Z3AvZnJhRmlqb3gyZkN6ZDY3?= =?utf-8?B?L1FVL0lIVnN2ZXpFaldxc3VCWDl1R3J5MEg5dHdKbUZyMGZOK3lYRzFEd3JB?= =?utf-8?B?ai84SFptNlMrcUJEZU8xV0VjcllGb1pRTUJsL1pnMW5rUDhsaUd0L2FZT3pB?= =?utf-8?B?anFLVEtYMDMrdXpXMjY3RGgvVE4wbzcwOGphOG8wMFE5OHE5d01ucUVlTWVU?= =?utf-8?B?NUtZSlRHMFc2b3AxZGNsNkwxazNNRnFLSDlDSitZUHRscHJRcmNDdjFjSXdu?= =?utf-8?B?M0JpeEpqNnhZSVdQSk5WK1dOaXFmV2tmRkFRWW1RS1IxSHEwMG1xQ25oMmlH?= =?utf-8?B?L1hNOWVydVBkWkZ6Lzh6WFJxRjNoSW9sTFZEaVlwZGNuRllZRzFSRkswS0Ew?= =?utf-8?B?bUUxbVltY2huK2xuamJYcWVPQTJ4UnBiaXNnVzhicVc4YkRQU0d6aU5zeGs4?= =?utf-8?B?NzNuWGw1L2JVajR1NElZdG9NVDhpbFptVnd1cEN3TmNVWjBFMTRSeG9uaHpr?= =?utf-8?Q?x75RwT+sbXVdLbDLOxQyZhH+Irm4Upn2EATtCM=3D?= X-Forefront-PRVS: 0371762FE7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(6049001)(39450400003)(39830400002)(39410400002)(39400400002)(24454002)(377424004)(64126003)(7736002)(50466002)(305945005)(38730400002)(8656002)(110136004)(74482002)(54906002)(6246003)(6916009)(2950100002)(6666003)(229853002)(2906002)(4001350100001)(478600001)(36756003)(83506001)(81166006)(54356999)(8676002)(76176999)(23676002)(50986999)(7350300001)(53546010)(6116002)(189998001)(575784001)(86362001)(3846002)(5660300001)(7416002)(31696002)(77096006)(6486002)(65806001)(66066001)(4326008)(117156002)(33646002)(47776003)(53936002)(3260700006)(25786009)(42186005)(65826007)(31686004)(230700001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0202MB2557;H:[192.168.13.3];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTc7MjM6a3JGWENSa1FPQU4xL1cyOUdjNk5WdzN0?= =?utf-8?B?U01TdVdUdTBnck4xMUpibmtqb05QSG9SVzZXQ3dyeTBURUtUWmRqdmxVVUpx?= =?utf-8?B?ZmNHRGNSYmc5UlpNV3kwamdIbGlCUGJQM3RndktqdzVpbjdkVHdONGJvcmV0?= =?utf-8?B?U1hoNjlpVzNKbXJORTQzajlldU5oeWxHNUdhY2pwYzMrRWJWMklRWjNhdENr?= =?utf-8?B?aitKVk5GRDE0RlFRVjBPZnlyK0F0QnltN0U3KzRYNEhEMjFBUmY1bDgweDlH?= =?utf-8?B?VmZBRWJFWXNYdllod3R2WWNOeTVaVVRBdGlNLzlxOHBVWEg4M0d0cU45MG4r?= =?utf-8?B?d3A5Q1E3ckJFb2hJNnhzTDE3cVY3M3FHTjFYY252SG8yMzFLOENJbkQ1ZGwr?= =?utf-8?B?aEVhMUFTeUlZN0s1YktIeGhIb2VlSG1zeXBJUFdGaU1nOUpBZlkwaGhOd1lI?= =?utf-8?B?NTREMHJwNjErY2F0eUtMNHJkY0RlYUlHRGtYMnpLZ3o1RnFvMDBtSkdpTFc0?= =?utf-8?B?Zi9SWlJkN1BXRENqRm5NbU9QbWxkOXpMbHFITGpKNjZiZXFoL1ppZThhZE5G?= =?utf-8?B?d3I4RGsxcVBCUCtqU3FrSTZV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utf-8?B?YUVpRnowcWNjT2FVMThlSzlPck9TeitHSWlScHRBYVhFYTY0aEg1ejdlTzdq?= =?utf-8?Q?eqNgauopNt0ZuXVJwDzjY4WW/81gRZHYk=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2557;5:adF9CrtPA36iDweWceuVkAEnTJ5in9pjD9V2FRwj6xbJ3KpMBDt7cT097ZwxqlMaQI+wgegmTuEZslmTxbBI5D7qdrARJCaPI5rJ6qblMiTq4HybFlcuBaUR/Jq/j+wdrLkoqZzTD7lmgoo/wexAkiVseige3az+3JkSvk7qHHeIjh2oPqa2G+DPO6fA95aVxRfAMocHHI2d6dp5l9AP7LM4o8H9idZb7VkLHuxOdblCv8UInrVcE46I/RmXHXI/pC1i6aIK9BZiDk7/WeDGJI4Gp9co9u57GvKBAExZtbSK97676u9gRkEHoUbWgGW5jZ8ZX4i05Dg7YSrfeMejZAULFdLE9sgb7Ev2L7vKhmgeQ9oyM9bG9zSlYg0q/a26CAnrx1QhKzJSAKwWX5kJEmiYmAyHYM9xv6GcNzmuXJltHJDlM9+c40Ug7/dypVXT+sB2fK22TS4wWmy5XpwDyaRR489a59z4i6Eb0AiMAuKLz5yWX3Ne1w/e/AKQwQBl;24:d82A5PLhfavR0tX1kvgPvLjv4aoNEJZ6snKGjGTUn72UeLCZV6CSIytDijwtlnqyIVSal1UCWFFlOeEIRITDKqYq0w5l9Qol6jqjmsomFkg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2557;7:VCNms6Bs5oc/WVaUvSpNgyW8ka0tF6VxwthL8zUk39fUYG4rZqe5FzGzPvXw/wZilb/QqqArESm4BB+f9ytS99jL7OYR7YUSG4nSqe4tOsU+uKaH1eEJA5SN8Mz6Mzt0DjSSve9fqPo2jGT1gimySUWqWNPrGwkRERmMaJN2qJrggTIxm/dsLmZsumizEuF0q6ytcJb5fcksq3UrieSCsfgJcQdFt/if+lxY+udTZ16zgCwDJYU6D2WWYZT/9JuWq1nN9QjP7585u/qGkC+aUhqShemeaU357C8QFprXSNehUQAH983a0S0ZxdMOsYEPM3lynvlEMkYozEwKvqRzTzxo2kWvzeyhAybNpr8IH0fQWnvdWXa3NmyHoqFtUzVmvww+B6R2pfsqNwI5IJPTn5fL/aR2jxrhYyUpPbpO8p/c6ZH4VsgsLfwOIIu0HhvC+OmHqo6n8qwEaEeqh4jJmjl+YDQw45CJi8069OVFSUmDxTq2XdRvNWZzZ4ZCbjdGq9wWAV3MC0IfX4lib7EozIYJz9nei+opOnROFFWBNoQ9dOWcG6mAxxSNpRIg/r4T6bDZjCzSzycVtH79l5CMxE6jrPQUaDzxk9s3qiP6N8HmD7hLeaDwzrier+MMNMkFCniW/BkrcWbL59Mp+e3gNiWvcxhVUb+ZpBGwQfc00BKcmpZmWTduaDvIKVQvxh6gingAbXJfi20vLx3Nz/HFcNJ4XFpff4d2Sf2X2AUVqZX8S8Or8RuDDua3TCAuQaMFWf9p/DV9jGRMclWxsu8L1TpSvkixy2DFp0dlKpOgrPk= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 08:20:18.2160 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2557 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9450 Lines: 275 Generally looks like I imagined, but there are a few nits and some things that I'd like to do differently. Comments inline. Thanks! On 2017-07-14 23:40, Stephen Boyd wrote: > Sometimes drivers only use muxes under certain scenarios. For > example, the chipidea usb controller may be connected to a usb > switch on some platforms, and connected directly to a usb port on > others. The driver won't know one way or the other though, so add > a mux_control_get_optional() API that allows the driver to > differentiate errors getting the mux from there not being a mux > for the driver to use at all. > > Cc: Jonathan Cameron > Cc: Philipp Zabel > Signed-off-by: Stephen Boyd > --- > Documentation/driver-model/devres.txt | 1 + > drivers/mux/mux-core.c | 98 ++++++++++++++++++++++++++++------- > include/linux/mux/consumer.h | 4 ++ > 3 files changed, 83 insertions(+), 20 deletions(-) > > diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt > index 30e04f7a690d..4fdd3e63ff8b 100644 > --- a/Documentation/driver-model/devres.txt > +++ b/Documentation/driver-model/devres.txt > @@ -342,6 +342,7 @@ MUX > devm_mux_chip_alloc() > devm_mux_chip_register() > devm_mux_control_get() > + devm_mux_control_get_optional() > > PER-CPU MEM > devm_alloc_percpu() > diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c > index 90b8995f07cb..a0e5bf16f02f 100644 > --- a/drivers/mux/mux-core.c > +++ b/drivers/mux/mux-core.c > @@ -289,6 +289,9 @@ EXPORT_SYMBOL_GPL(devm_mux_chip_register); > */ > unsigned int mux_control_states(struct mux_control *mux) > { > + if (!mux) > + return 0; > + I don't think this is appropriate. For this function, it might be ok, but... > return mux->states; > } > EXPORT_SYMBOL_GPL(mux_control_states); > @@ -338,6 +341,9 @@ int mux_control_select(struct mux_control *mux, unsigned int state) > { > int ret; > > + if (!mux) > + return 0; > + ...here and for other cases below it's very odd to return "ok", when -EINVAL or something seems much more appropriate. And if -EINVAL is returned here, the benefit of returning fake values for anything pretty much falls apart. I simply don't like it, and prefer if the consumer code is arranged to not call the mux functions when the optional get() does not find the mux. > ret = down_killable(&mux->lock); > if (ret < 0) > return ret; > @@ -370,6 +376,9 @@ int mux_control_try_select(struct mux_control *mux, unsigned int state) > { > int ret; > > + if (!mux) > + return 0; > + > if (down_trylock(&mux->lock)) > return -EBUSY; > > @@ -398,6 +407,9 @@ int mux_control_deselect(struct mux_control *mux) > { > int ret = 0; > > + if (!mux) > + return 0; > + > if (mux->idle_state != MUX_IDLE_AS_IS && > mux->idle_state != mux->cached_state) > ret = mux_control_set(mux, mux->idle_state); > @@ -422,14 +434,8 @@ static struct mux_chip *of_find_mux_chip_by_node(struct device_node *np) > return dev ? to_mux_chip(dev) : NULL; > } > > -/** > - * mux_control_get() - Get the 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, or an ERR_PTR with a negative errno. > - */ > -struct mux_control *mux_control_get(struct device *dev, const char *mux_name) > +struct mux_control * > +__mux_control_get(struct device *dev, const char *mux_name, bool optional) > { > struct device_node *np = dev->of_node; > struct of_phandle_args args; > @@ -441,6 +447,8 @@ struct mux_control *mux_control_get(struct device *dev, const char *mux_name) > if (mux_name) { > index = of_property_match_string(np, "mux-control-names", > mux_name); > + if (index == -EINVAL && optional) > + return NULL; What about -ENODATA? And if an optional mux is found here, but lookup fails later in e.g. the of_parse_phandle_with_args call, then I think an error should be returned. Because that seems like an indication that DT specifies that there *should* be a mux, but then there isn't one. > if (index < 0) { > dev_err(dev, "mux controller '%s' not found\n", > mux_name); > @@ -451,6 +459,8 @@ struct mux_control *mux_control_get(struct device *dev, const char *mux_name) > ret = of_parse_phandle_with_args(np, > "mux-controls", "#mux-control-cells", > index, &args); > + if (ret == -ENOENT && optional) > + return NULL; > if (ret) { > dev_err(dev, "%s: failed to get mux-control %s(%i)\n", > np->full_name, mux_name ?: "", index); > @@ -482,9 +492,35 @@ struct mux_control *mux_control_get(struct device *dev, const char *mux_name) > get_device(&mux_chip->dev); > return &mux_chip->mux[controller]; > } > + > +/** > + * mux_control_get() - Get the 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, or an ERR_PTR with a negative errno. > + */ > +struct mux_control *mux_control_get(struct device *dev, const char *mux_name) > +{ > + return __mux_control_get(dev, mux_name, false); > +} > EXPORT_SYMBOL_GPL(mux_control_get); > > /** > + * 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, or an ERR_PTR with a negative errno. You don't mention that NULL may be returned, or when. > + */ > +struct mux_control * > +mux_control_get_optional(struct device *dev, const char *mux_name) > +{ > + return __mux_control_get(dev, mux_name, true); > +} > +EXPORT_SYMBOL_GPL(mux_control_get_optional); > + > +/** > * mux_control_put() - Put away the mux-control for good. > * @mux: The mux-control to put away. > * > @@ -492,7 +528,8 @@ EXPORT_SYMBOL_GPL(mux_control_get); > */ > void mux_control_put(struct mux_control *mux) > { > - put_device(&mux->chip->dev); > + if (mux) > + put_device(&mux->chip->dev); Don't put it if you don't have it. > } > EXPORT_SYMBOL_GPL(mux_control_put); > > @@ -503,16 +540,8 @@ static void devm_mux_control_release(struct device *dev, void *res) > mux_control_put(mux); > } > > -/** > - * devm_mux_control_get() - Get the mux-control for a device, with resource > - * management. > - * @dev: The device that needs a mux-control. > - * @mux_name: The name identifying the mux-control. > - * > - * Return: Pointer to the mux-control, or an ERR_PTR with a negative errno. > - */ > -struct mux_control *devm_mux_control_get(struct device *dev, > - const char *mux_name) > +static struct mux_control * > +__devm_mux_control_get(struct device *dev, const char *mux_name, bool optional) > { > struct mux_control **ptr, *mux; > > @@ -520,7 +549,7 @@ struct mux_control *devm_mux_control_get(struct device *dev, > if (!ptr) > return ERR_PTR(-ENOMEM); > > - mux = mux_control_get(dev, mux_name); > + mux = __mux_control_get(dev, mux_name, optional); > if (IS_ERR(mux)) { > devres_free(ptr); > return mux; > @@ -531,8 +560,37 @@ struct mux_control *devm_mux_control_get(struct device *dev, > > return mux; > } > + > +/** > + * devm_mux_control_get() - Get the mux-control for a device, with resource > + * management. > + * @dev: The device that needs a mux-control. > + * @mux_name: The name identifying the mux-control. > + * > + * Return: Pointer to the mux-control, or an ERR_PTR with a negative errno. > + */ > +struct mux_control * > +devm_mux_control_get(struct device *dev, const char *mux_name) > +{ > + return __devm_mux_control_get(dev, mux_name, false); > +} > EXPORT_SYMBOL_GPL(devm_mux_control_get); > > +/** > + * devm_mux_control_get_optional() - Get the optional mux-control for a device, > + * with resource management. > + * @dev: The device that needs a mux-control. > + * @mux_name: The name identifying the mux-control. > + * > + * Return: Pointer to the mux-control, or an ERR_PTR with a negative errno. You don't mention that NULL may be returned, or when. Cheers, Peter > + */ > +struct mux_control * > +devm_mux_control_get_optional(struct device *dev, const char *mux_name) > +{ > + return __devm_mux_control_get(dev, mux_name, true); > +} > +EXPORT_SYMBOL_GPL(devm_mux_control_get_optional); > + > /* > * Using subsys_initcall instead of module_init here to try to ensure - for > * the non-modular case - that the subsystem is initialized when mux consumers > diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h > index 5577e1b773c4..5e2aa046f032 100644 > --- a/include/linux/mux/consumer.h > +++ b/include/linux/mux/consumer.h > @@ -24,9 +24,13 @@ int __must_check mux_control_try_select(struct mux_control *mux, > int mux_control_deselect(struct mux_control *mux); > > struct mux_control *mux_control_get(struct device *dev, const char *mux_name); > +struct mux_control *mux_control_get_optional(struct device *dev, > + const char *mux_name); > void mux_control_put(struct mux_control *mux); > > struct mux_control *devm_mux_control_get(struct device *dev, > const char *mux_name); > +struct mux_control *devm_mux_control_get_optional(struct device *dev, > + const char *mux_name); > > #endif /* _LINUX_MUX_CONSUMER_H */ >