Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbdGHVM0 (ORCPT ); Sat, 8 Jul 2017 17:12:26 -0400 Received: from mail-eopbgr30099.outbound.protection.outlook.com ([40.107.3.99]:45128 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750883AbdGHVMY (ORCPT ); Sat, 8 Jul 2017 17:12:24 -0400 Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH v1 1/1] mux: Add new API to get mux_control ref by device name. To: sathyanarayanan.kuppuswamy@linux.intel.com Cc: linux-kernel@vger.kernel.org, sathyaosid@gmail.com References: From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <08b3c179-6e58-73c7-5221-4b9b12d7ea9c@axentia.se> Date: Sat, 8 Jul 2017 23:12:16 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: HE1P191CA0008.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::18) To VI1PR0202MB2558.eurprd02.prod.outlook.com (2603:10a6:801:6::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d32b9645-beb9-4231-55b2-08d4c646059e 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:VI1PR0202MB2558; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0202MB2558;3:1ebOzc4canpJpdx8ru0oD1vTayi6u60v6HwnkQWAxyFNYwIfBt7BWOznvCR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0RYbuIRs7T8AFC9v5ojkbi5SMFLZFsxYVFbxYcAEba0lKvR3/RKNnRD1NWgqaykL7jrqM3hKy0p/i5DAATUm/JHpFiiWyuGuahAXdP1kMMazVOdtiQEDOIMkA0zW/mVaDbd+lcoyx6DHGcgRyAJ8dkdU54qfk7UiMAzIl4OG3XtvubAZvgR/9RU1DGj2EQ01KZcX/1qL0LpFTKaGLOgQqbNNyiSRkVvyiDsAtKINLt7Y98r88RlPplOW3M8U38A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(148574349560750)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(2016111802025)(20161123560025)(20161123558100)(6072148)(6043046)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0202MB2558;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0202MB2558; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTg7NDpMbytsYzM4V1Q5d1BsS3RsSC9RUFlkWTBH?= =?utf-8?B?SlN4RkFqeEw5bFdtT1ZaWHZFbm1PNzJibE53VVJTMmY4WHdyOHBxVWIwNlB0?= =?utf-8?B?SjMwUzF0akZ6NG5aV08zdEltR2U2TkJ6YUR4cnN4bE9HWDZKSE1WNDhWRTQr?= =?utf-8?B?WmlKckNaZnV2bW9aSWlKNDNid1I4R1NWbXVVTmU2bFNjQUlZSHpRRXFlMFJF?= =?utf-8?B?dmRqZ0NvZWZ0THBpdlFDZ1VHaFNBeWVlW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KMlVKY0kvMzBpWkVoNU0vZkdHbzZ2clZpZFVB?= =?utf-8?B?ZDI5SUpOMFlXRTA2SlRtamtxT0E5RW4zMC85RE5zdHZ0UXFOTk5La1E2aGZM?= =?utf-8?B?YlE3UE1FYkNJYnFIdlBrdk1iNTQzRzZVd0l4QVdHRzRvYi9TcEJiaC9sWHAy?= =?utf-8?B?WXFZL0FQNDR3VWlYVzJyUi9lN0tWYldHU2pqTnl0ZEhjd1ZlTzY5eGIwNW40?= =?utf-8?B?SmsrenRuOHp6d0k4TjlPcnM4bms5QSsrNktiaSs3TGpvWXVTWC9vdWIyODlQ?= =?utf-8?B?UUxpOEs3amdGeExnQlVIdjRBSVlzRmFWdkF4RUpUUk0wVG1mMEFkYVg5NExV?= =?utf-8?B?M2p1dmROYVI4SVYxVE9yd1JTY0lMdXA3K2RxUlRzaTgzckduNDlreXFlZjBU?= =?utf-8?B?Z1UvckxHK2pwTXNFbFB5bWhCbUNWMW5KbGRVdlBNblRXNmgwOXYrZWxZbk9q?= =?utf-8?B?NmEyTVg0OXBQWlFXcWxJWEdDaXRzUjI5eEkvZXdIaE5zQTY4VHZ0eXZyeVhQ?= =?utf-8?B?ZDgvczhVdWlhRnBEdmdIc2lQZm1uYUtBNklLTVNPQk4yNWh2UkdFTzYyV2Vw?= =?utf-8?B?OWR5MDd1L1Jrc3ZhWVhqNnFhRzMxazBKOFlUMHBXaXBQb1BRZHpWNGwrTE9u?= =?utf-8?Q?Ug3tBfRrDhFMgM?= X-Forefront-PRVS: 0362BF9FDB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6049001)(6009001)(39450400003)(39410400002)(39400400002)(39830400002)(24454002)(377424004)(66066001)(65826007)(31686004)(42186005)(54356999)(50986999)(6246003)(110136004)(76176999)(33646002)(189998001)(4326008)(25786009)(38730400002)(5660300001)(2351001)(2361001)(117156002)(47776003)(81166006)(2906002)(36756003)(8676002)(23676002)(64126003)(305945005)(230700001)(2950100002)(6666003)(74482002)(6116002)(3846002)(50466002)(7736002)(6916009)(6306002)(83506001)(966005)(77096006)(86362001)(31696002)(478600001)(4001350100001)(53546010)(7350300001)(53936002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0202MB2558;H:[192.168.13.3];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjAyMDJNQjI1NTg7MjM6dWV3LzdRMGxySHNlamtOREloUG9RQml4?= =?utf-8?B?b2lMTFBpZ0ZPbnNqaWxYZGhONHp3QkJyMkZCSldhSDBhY1pwaFNvOFE5Y0Nq?= =?utf-8?B?TlhWeHBNQm9ZUWJ6Qk9rU3F3N2VOSkh1SU01TXpJVE1MYUxDTmJuVzN6bWJh?= =?utf-8?B?U20zZDd4VFVMYkxiTTgrN3dpUzcrOE9aY2N2NnFNNkhUTjRaZUJRdU5oYVIr?= =?utf-8?B?bVFtNHBrZ2FiL2x6TVU2Q3kwRm9nak5PMXB2R2V6YmJvK1d6R1VRVFQ5dExD?= =?utf-8?B?UnlOT0liTjZaU2VyTVNiUldyMzk4Q2pJeXVZL2xaWW5IN3VLTWNocjFoUG9w?= =?utf-8?B?K3NhOVAralZQaFZGdTBEV0FnUW1icURBYURJMCtyZ1gwbmJ6S0dmRlJLQlJy?= =?utf-8?B?ZkZjMEQzME9zbUpRNXpZcEo1UVpwbWJ2Nnh0RDFSQVdoWDJHVFVTNkx1KzRP?= =?utf-8?B?SS90c3NvSUFMd2pPY25PVG4rK0tsY05CVS96V1RkOU9ZSkhxRTBqeVlzY3lN?= =?utf-8?B?akhMOHVXTjhHZ0lCRUJ4dGhVcTRudHo2WGt3cnh3VDFSNVJCOEdBeVNRamsy?= =?utf-8?B?cnh5aG5pRzBIYTNrMTVoR1M2MkowZXoweDN6RDJWaDJvZG9DYzlJQSttcHd0?= =?utf-8?B?WXY2Y05xeDBkODBkSStaZE13c3lQTGxwNWlJczl6VWdrRUZGdHlhMG53RTh6?= =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wsreLVkJWSNR78NDKOklUNVl1pFU4SiKiwvUa+FTyQ7UpkL9ciKfwSCIxhdsAjvHFSvCcyEAXjHW8xWt1jHjKbM0tN7SOY6+8bt97FGrjyrZRruqRATQM2bCn5HuV7SDTYcaoJZkTsXezeK8k2pkR1Edf+QFUzAgRDeLoU535CDwqjIgjmm50CorBXW/NHER9lLRXTyUm22UqN3L6noTWYNY6YE0Ja9GYEDt3ZC50jmhLpJvjRiXnLJKLFz/E9q/ZI7iJJ5A668Kwp1yelBLjEjbyJGeZyCvYC/r8N5hDn5Qg4Xb+3w8hJ66KBIR5JYJyEoZfyQIC0pwSL9gptaWQzQmJoyGINcZF4s= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2017 21:12:20.4886 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2558 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6298 Lines: 195 On 2017-07-08 00:03, sathyanarayanan.kuppuswamy@linux.intel.com wrote: > From: Kuppuswamy Sathyanarayanan > > Currently this driver only provides a single API, mux_control_get() to > get mux_control reference based on mux_name, and also this API has tight > dependency on device tree node. For devices, that does not use device > tree, it makes it difficult to use this API. This patch adds new > API to access mux_control reference based on device name, chip index and > controller index value. I assume this is for the Intel USB Multiplexer that you sent a driver for a month or so ago? If so, you still have not answered these questions: Is any other consumer in the charts at all? Can this existing consumer ever make use of some other mux? If the answer to both those questions are 'no', then I do not see much point in involving the mux subsystem at all. The Broxton USB PHY driver could just as well write to the register all by itself, no? that I asked in https://lkml.org/lkml/2017/5/31/58 What is the point of that driver? > Signed-off-by: Kuppuswamy Sathyanarayanan > --- > drivers/mux/mux-core.c | 114 +++++++++++++++++++++++++++++++++++++++++++ > include/linux/mux/consumer.h | 6 ++- > 2 files changed, 119 insertions(+), 1 deletion(-) > > diff --git a/drivers/mux/mux-core.c b/drivers/mux/mux-core.c > index 90b8995..f8796b9 100644 > --- a/drivers/mux/mux-core.c > +++ b/drivers/mux/mux-core.c > @@ -422,6 +422,87 @@ static struct mux_chip *of_find_mux_chip_by_node(struct device_node *np) > return dev ? to_mux_chip(dev) : NULL; > } > > +static int dev_parent_name_match(struct device *dev, const void *data) > +{ > + const char *devname = dev_name(dev->parent); > + unsigned int i; > + > + if (!devname || !data) > + return 0; > + > + for (i = 0; i < strlen(devname); i++) { > + if (devname[i] == '.') > + break; > + } > + > + return !strncmp(devname, data, i-1); Ouch, strlen as a termination test is wasteful, you want to remove the loop and do something like this return !strncmp(devname, data, strcspn(devname, ".")); > +} > + > +/** > + * mux_chip_get_by_index() - Get the mux-chip associated with give device. > + * @devname: Name of the device which registered the mux-chip. > + * @index: Index of the mux chip. > + * > + * Return: A pointer to the mux-chip, or an ERR_PTR with a negative errno. > + */ > +static struct mux_chip *mux_chip_get_by_index(const char *devname, int index) > +{ > + struct device *dev; > + int found = -1; > + > + if (!devname) > + return ERR_PTR(-EINVAL); > + > + do { > + dev = class_find_device(&mux_class, NULL, devname, > + dev_parent_name_match); > + > + if (dev != NULL) > + found++; > + > + if (found >= index) > + break; > + } while (dev != NULL); This loop is broken. class_find_device will always return the same device. Also, if you fix the loop, why is the ordering stable and something to rely on? > + > + if ((found == index) && dev) > + return to_mux_chip(dev); > + > + return ERR_PTR(-ENODEV); > +} > + > +/** > + * mux_control_get_by_index() - Get the mux-control of given device based on > + * device name, chip and control index. > + * @devname: Name of the device which registered the mux-chip. > + * @chip_index: Index of the mux chip. > + * @ctrl_index: Index of the mux controller. > + * > + * Return: A pointer to the mux-control, or an ERR_PTR with a negative errno. > + */ > +struct mux_control *mux_control_get_by_index(const char *devname, > + unsigned int chip_index, > + unsigned int ctrl_index) > +{ > + struct mux_chip *mux_chip; > + > + mux_chip = mux_chip_get_by_index(devname, chip_index); > + > + if (IS_ERR(mux_chip)) > + return ERR_PTR(PTR_ERR(mux_chip)); > + > + if (ctrl_index >= mux_chip->controllers) { > + dev_err(&mux_chip->dev, > + "Invalid controller index, maximum value is %d\n", > + mux_chip->controllers); > + return ERR_PTR(-EINVAL); > + } > + > + get_device(&mux_chip->dev); > + > + return &mux_chip->mux[ctrl_index]; > +} > +EXPORT_SYMBOL_GPL(mux_control_get_by_index); > + > /** > * mux_control_get() - Get the mux-control for a device. > * @dev: The device that needs a mux-control. > @@ -533,6 +614,39 @@ struct mux_control *devm_mux_control_get(struct device *dev, > } > EXPORT_SYMBOL_GPL(devm_mux_control_get); > > +/** > + * devm_mux_control_get_by_index() - Get the mux-control for a device of given > + * index value. > + * @dev: The device that needs a mux-control. > + * @devname: Name of the device which registered the mux-chip. > + * @chip_index: Index of the mux chip. > + * @ctrl_index: Index of the mux controller. > + * > + * Return: Pointer to the mux-control, or an ERR_PTR with a negative errno. > + */ > +struct mux_control *devm_mux_control_get_by_index(struct device *dev, > + const char *devname, unsigned int chip_index, > + unsigned int ctrl_index) > +{ > + struct mux_control **ptr, *mux; > + > + ptr = devres_alloc(devm_mux_control_release, sizeof(*ptr), GFP_KERNEL); > + if (!ptr) > + return ERR_PTR(-ENOMEM); > + > + mux = mux_control_get_by_index(devname, chip_index, ctrl_index); > + if (IS_ERR(mux)) { > + devres_free(ptr); > + return mux; > + } > + > + *ptr = mux; > + devres_add(dev, ptr); > + > + return mux; > +} > +EXPORT_SYMBOL_GPL(devm_mux_control_get_by_index); > + > /* > * 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 5577e1b..e02485b 100644 > --- a/include/linux/mux/consumer.h > +++ b/include/linux/mux/consumer.h > @@ -28,5 +28,9 @@ 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 *mux_control_get_by_index(const char *devname, > + unsigned int chip_index, unsigned int ctrl_index); > +struct mux_control *devm_mux_control_get_by_index(struct device *dev, > + const char *devname, unsigned int chip_index, > + unsigned int ctrl_index); I want an empty line here. Cheers, peda > #endif /* _LINUX_MUX_CONSUMER_H */ >