From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62038159589; Wed, 28 Feb 2024 14:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709130288; cv=none; b=KClLve5lkKO5aogoXkXgg646Eur4/e3ocj2/arbNpXxhuYhmFVzPPjAFMEsCmfK4Zine4KyYDLALSCao1jyv96ptEQIUELQIY7frU/5kgSIQM6zilXw3fFjaqcgdNZ61CubPVcscIjrdvSkX06wI3Lu7Q6wVF5zAn8Z+JCI7I04= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709130288; c=relaxed/simple; bh=pRzq8HG/Yov3i+0nNUEbFITL218UFSc1UWUM1H32W08=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J3+yu9edJvzGNjmu+1lHF0brGMU9X9osyIJ4h6Vb6Ck0onXZUPfUbRvFANaGRjpirzVIA+iiMN4Z9dSvbA0k3fnmBrcyNLvYQlzc4NRRrQSQKPrlTpE38SfqSYwSb1QmU5FTpxaWsFiR5bdRgmziYQxnxJQ4jAuFa8MUYI257YM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TlGhg5GT7z6J9yk; Wed, 28 Feb 2024 22:20:03 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 50B9F1412F1; Wed, 28 Feb 2024 22:24:43 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 28 Feb 2024 14:24:42 +0000 Date: Wed, 28 Feb 2024 14:24:41 +0000 From: Jonathan Cameron To: Dominique Martinet CC: Krzysztof Kozlowski , Jonathan Cameron , Syunya Ohshio , Guido =?ISO-8859-1?Q?G=FCnther?= , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , Subject: Re: [PATCH] iio: industrialio-core: look for aliases to request device index Message-ID: <20240228142441.00002a79@Huawei.com> In-Reply-To: References: <20240228051254.3988329-1-dominique.martinet@atmark-techno.com> <7f03bb12-0976-4cb7-9ca9-4e4e28170bdd@linaro.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To lhrpeml500005.china.huawei.com (7.191.163.240) On Wed, 28 Feb 2024 17:11:59 +0900 Dominique Martinet wrote: > Krzysztof Kozlowski wrote on Wed, Feb 28, 2024 at 08:42:46AM +0100: > > >> Sorry, that's why you have labels and compatibles. > > > > > Setting up a fixed alias seems to be precisely what aliases are about > > > (e.g. setting rtc0 will make a specific node become /dev/rtc0, same with > > > ethernet0, gpio, i2c, mmc, serial...), I'm not sure I agree a new label > > > would be more appropriate here, but perhaps I'm missing some context? > > > > Maybe I don't get your point, but your email said "sysfs", so why do you > > refer to /dev? > > I wrote /dev/rtc0, but it also sets the name in /sys, right? > For example /sys/class/rtc/rtc0 > > As far as I'm aware iio also creates character devices in /dev with the > same name (/dev/iio/iio:deviceX), but our application doesn't use these > at all and has to? look in /sys directly, so normal udev SYMLINK+= > unfortunately isn't applicable or I wouldn't be bothering with all > this.. A given IIO device driver may create multiple sysfs directories (registers device + one or more triggers), so I'm not sure how this would work. > > > > I'm not sure I understand this comment -- would you rather this doesn't > > > use aliases but instead add a new label (e.g. `iio,index = <10>` or > > > whatever) to the iio node itself? > > > > No, the devices already have label property. > > Thank you for pointing me at the 'label' property, looking at other > subsystems e.g. leds I see paths in sysfs that use labels as I'd like it > to work for iio (/sys/class/leds/