Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2395610rbb; Tue, 27 Feb 2024 23:43:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX4VN3qg2tz9I5+FDWUwX5VE1UlZOEm03wvbok1/doFdhGWXcHz9zh7+YN9UU2+b24jR7ATe39fhbcQ3aoMiVloMhQZodR64Lwl1lG1Lg== X-Google-Smtp-Source: AGHT+IFY0OQgc2jJbKTczxHbvQKPnoykhSYQUL4pe6UX/9zXa6uvWz+7murZ4G3SRMgpv4W0Oz7B X-Received: by 2002:a0c:e2d3:0:b0:690:6e4:8a70 with SMTP id t19-20020a0ce2d3000000b0069006e48a70mr4480588qvl.21.1709106180432; Tue, 27 Feb 2024 23:43:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709106180; cv=pass; d=google.com; s=arc-20160816; b=ULQBaK0jw20v51mRBmVPJqJ+Bci4x5UyzHIhh6tzc4fcqgPRbuLJRJMi0sIcYXZuDV f60TSNhUwlLG7SYKSpoQhYlsCymQTJ6N5q/s/wgZny8CYznY8kDN+TGyFIsHlEf40RIz 5xZxw2w8GZqwsKjty8BakCDqpzenSm2ceYmtg5us4+8m9XSGyTfuelDuCQgv1HGlhY+w WX04P1PmZIxWfx9XhypDJVzxtpM4aHQGUyRtsKnbEEgAVnLZNkwWkj210Y/So6Kpk6OJ NYxU50fJ+TKoFuFSNiCMOfnSzX5h3LgjFbpwPw4OvqW8VCirShZpoVyWea2HJEawwz7D 7U7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=mQYBMAfRlY158XeZRXnO/C3REbH4KTGNj1xejarJZro=; fh=SX1Kfjn8wm77cTvxfGaBKpiBrOlXeWWvF4rZsqOGThE=; b=yQn+zkoPoVQjUxQB+r1KBRN6iussq5I7/nX4MYHxVO5XdrezE80syaiUlQnbr1q1CF ZCHMo+8jiBftZ5Wjvl06j4V6MsILwah+HbQy9YrWKaq3I6DCR7EWsKsNq2yDF1/lZU+o x8dDFZRu2aAik88i5UtuFHwPfSrt1lKlqnQaMOUnktqe9rftTAGbXztbWIW8v4pzV7dr 3nxXP90o2zWtnBQCMkfSyzRe5tFNoTa7ZtDwFsfM56YhTi/VJbxeHH6pxS5c33PrC39r QODal2O6eyTp565gj2D8lkE5VownF07oSwUuxgTVAalE2Uq1a4+sR5j7av1KLpjqIY6A U1sA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dPHhXf3L; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-84626-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84626-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r14-20020a056214124e00b00690191023c1si4498177qvv.561.2024.02.27.23.43.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84626-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dPHhXf3L; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-84626-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84626-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 242BD1C21DA3 for ; Wed, 28 Feb 2024 07:43:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 179EA25574; Wed, 28 Feb 2024 07:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dPHhXf3L" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 367C7250F6 for ; Wed, 28 Feb 2024 07:42:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709106173; cv=none; b=G9D2yeA6nIK4tLjjfs+w/InRkFPy7v5L0z0ajtiTghQa0lotCJGIkmfMxRQH0y0v+ii761LJFac+uExBkiMYI4n2ZAkq/U0e3EnDopRaMlW63BVyfJBWkxARssayxG4FXHqugfVbH5C+2Xae5FDP99zUCfFwSOqzWEvWRLOXkh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709106173; c=relaxed/simple; bh=2z/mrd9QvlkiZfZzv2pdK+B8HyWJmS5sRKml1NG7xcQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R5TAkmcQy+Owfy+5oaXSwJRNS9WHWp2Z7DyXSoArDj3MES5n35TmXEUu9mlHhK/qzmj6gLdIopArQ9pW3DMk5jV4itiCDetI94HrSGkuYNEZ5qvq4+2JN8TpDEw6NHTZ2hyotl+ygs22WnPFfOs0Ve5o6nRo84KDYE22y6se3FI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dPHhXf3L; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a3f893ad5f4so712543366b.2 for ; Tue, 27 Feb 2024 23:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709106169; x=1709710969; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mQYBMAfRlY158XeZRXnO/C3REbH4KTGNj1xejarJZro=; b=dPHhXf3Luy03K2s9DTLiZX5xDz+/y/Rb6jFhLFjbnYmtL8jcsPvJTgpqYjRGqGM7GQ dZNDRHR3zVgWJJ5v4YaUQWHSMIExyCwd2ZdKFY1MA2mQR2z+qFaC7YAvlJviFa37Sus1 V7lL9yAK+LC6xmlimNGjyaHrq76JLB6kMPL4T+U5f9SHV//TNF18ppKneaTFXiddSBVJ Kt7F1yLlw5JCNSM5RcWvxGdVY56mjzK43M6nit1mYNkrLCQMjb//rCX6hIULwWo0ImU/ qsBkN4KP/rXzn+pVFPLsO/43uxMpwJlBportHf/EaXfw/ciQoBQwg8R6uFVa1GBsGXP1 7v3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709106169; x=1709710969; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mQYBMAfRlY158XeZRXnO/C3REbH4KTGNj1xejarJZro=; b=CLhmSSLDmLs2ALERhO/3IBWsvByjUqZ7jnBPQe0DMQW+16caHfZUfVQWlpg/hYEzzf 0WpC1ChK59W/ZIiRAFflGgCe+XhJ4JPc8GiJi0vXL609yaOgp+L+TyZm9PcngSsGDL0y 7gAqkj47bHw7qoRpy7ACX+6X8TVmCFeHlq4RyIPMk6EKNGuDdiH7L4b/0xPXbfReZkul 5azCJncvP+1ZmbOFY1gi1weeLVAMcToGm+vV5r2xjPHGJaAHQwSgeU0ucRRdvH2rITSd FwnK3VNFRjGiGgUdesfAStt23+rJFgIrP/wliOAfEkMo+Choi89DRw1QrHGhl+pb7TzX fQDw== X-Forwarded-Encrypted: i=1; AJvYcCWFauW4TaQmKNG+hhx6XO9paKp8LhOHIgu6y+Jm/d3w5i0O0N2SY1AkOM3AOZ5E0XKQPN79HKA2u2j/d0eOHpzz5KSWvShcOYPnXtUA X-Gm-Message-State: AOJu0Yy28ZCb1QIhbgAZfrl6F43JmUtAfO4pCnniKAguMtiZUCKJVGHA g01qA/p2BdaDly6qXt2yYb54KQiWZfJ1LhvRYOcFP4U+SPAEkjIK/KFFiTgOZ09/t4UFUe73/R/ u X-Received: by 2002:a17:906:6d7:b0:a44:f85:a10a with SMTP id v23-20020a17090606d700b00a440f85a10amr271835ejb.14.1709106169409; Tue, 27 Feb 2024 23:42:49 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.116]) by smtp.gmail.com with ESMTPSA id cd14-20020a170906b34e00b00a4412406741sm67118ejb.131.2024.02.27.23.42.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 23:42:48 -0800 (PST) Message-ID: Date: Wed, 28 Feb 2024 08:42:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iio: industrialio-core: look for aliases to request device index Content-Language: en-US To: Dominique Martinet Cc: Jonathan Cameron , Syunya Ohshio , =?UTF-8?Q?Guido_G=C3=BCnther?= , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240228051254.3988329-1-dominique.martinet@atmark-techno.com> <7f03bb12-0976-4cb7-9ca9-4e4e28170bdd@linaro.org> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf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U EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28/02/2024 08:31, Dominique Martinet wrote: > Krzysztof Kozlowski wrote on Wed, Feb 28, 2024 at 08:16:03AM +0100: >> On 28/02/2024 06:12, Dominique Martinet wrote: >>> From: Syunya Ohshio >>> >>> When using dtb overlays it can be difficult to predict which iio device >>> will get assigned what index, and there is no easy way to create >>> symlinks for /sys nodes through udev so to simplify userspace code make >>> it possible to request fixed indices for iio devices in device tree. >> >> Please use subject prefixes matching the subsystem. You can get them for >> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory >> your patch is touching. > > Sorry, I assumed that was already the case and didn't think of checking > that from what I was given, I'll fix the prefix to "iio: core: .." in v2 > >> Please run scripts/checkpatch.pl and fix reported warnings. Some >> warnings can be ignored, but the code here looks like it needs a fix. >> Feel free to get in touch if the warning is not clear. > > Hm, I did check that and do not get any warning about the code itself: > > $ git show --format=email | ./scripts/checkpatch.pl -q > WARNING: DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.rst > > total: 0 errors, 1 warnings, 61 lines checked > > What are you thinking of? You have warning right there. > > Regarding the dt binding, I'm not actually changing a binding so I > didn't think of rechecking after adding the note, but I guess it still > ought to be separate; I'll split it in v2. > >>> For platforms without device trees of_alias_get_id will just fail and >>> ida_alloc_range will behave as ida_alloc currently does. >>> >>> For platforms with device trees, they can not set an alias, for example >>> this would try to get 10 from the ida for the device corresponding to >>> adc2: >>> aliases { >>> iio10 = &adc2 >>> }; >> >> Sorry, that's why you have labels and compatibles. > > 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. > > 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? Best regards, Krzysztof