Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2581323rbb; Wed, 28 Feb 2024 06:25:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWXiubXfsEqlNtCW7AM/qCVWivDvX845bZX21mfXkG521dURdhxkIsNCmLvvpRcq9xsM2R0z/tQXo311tVOhLclThMkkg855C2klgTNg== X-Google-Smtp-Source: AGHT+IFEqoSTWQ0wZAeKQ/h6ESgoORForOQ0EjXqFMYfl3NIdjlfmKMF9HPA2jNTvJlnZ3XCs4iz X-Received: by 2002:a92:ce0e:0:b0:365:b570:cbbc with SMTP id b14-20020a92ce0e000000b00365b570cbbcmr2815894ilo.10.1709130308016; Wed, 28 Feb 2024 06:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709130307; cv=pass; d=google.com; s=arc-20160816; b=qMWUqJ2bDK3a8DGT88kgWyrHRxk05LvIUT6actWafLDJmfOwzNfpJY12r2GSp11AzL NhWO7f3BojMw6Ew1z+SlSDTbejdER3QCYccoTKI0A7WkIt+fEC+upV5Huvp+JQX+7gLY B6Tr+A5773kFYZfy1XVuk41nzpa1vObvKQBGfQS2l9j68QTD6Clut/GG4OdPrdCRTz3H B71tCoxi89FiF8iwOqFUDJ6CdUIG+cAK5kWZQszESgaX6qGUeZ5ZPCp2R/jf7EKXCN2o VqvgwgO/eRArOlT+NwjKcd5/OTPxzBv0pJ5RMhd2N+lAHpBSoqDJ3UQ9IVmsyfXVss82 NICA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=JRkvihyyt6RBk1Rz37ORAS4cP5toMhz/jcU9x9Jg17w=; fh=hCG6xu+mq/HRM6MAx5cuJyJofTd2HB2uUjFPn/5APtM=; b=dBq06SSjH79tKZtx30V3Px/nOAVLuc8GjRGTwSZn3gW1seARIBZx6NYndWjM8JVtxX uBYDqhc8KJm97l6bYXIrtBY6ydDcp6Kipkj46ISdjhV3NFrHUEPcImQd5kWyJqwuD17E p9I+PmpflSB5Fq9JsoHLO3na25LUqu1rIEtRW7z6RY4qC+Q1H00nGYCsqXR9ni00G9z3 4hH5xVVKaJvzAAAh3/4VYhvlsZhXbkcSldapLuwtnsuwUYERhLyJYnMr1lCRw0j0BAbd worxQG7RRxNtfV+NGsKwp7MYuYjY//53GJ8LahfGno0YVcacAnKVbEF8fCeg8elqXRnt Wz/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-85179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m8-20020a633f08000000b005d8ad5aa264si7498363pga.798.2024.02.28.06.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 06:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-85179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ACA8628A32E for ; Wed, 28 Feb 2024 14:25:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5616115A48F; Wed, 28 Feb 2024 14:24:49 +0000 (UTC) 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/