Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2388170rbb; Tue, 27 Feb 2024 23:19:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW06A59CG4VD6SwcBDNRSS2KR79iFnm2TOGqQAr6pGiavlf1oAa73MR+bsST1GgKH+W/VYCPUA3K+H61nVp1sgQy31cJBEYyLmlgOsHwg== X-Google-Smtp-Source: AGHT+IHxZokqh+Wl3VSiy23l7cJv6ZifPTLBHpQrXKzJUw1+FsGeZibAPDHN3FgUsHsLm+NH7HjX X-Received: by 2002:a05:6a20:88a5:b0:19c:9b38:f398 with SMTP id d37-20020a056a2088a500b0019c9b38f398mr3943752pzf.22.1709104778266; Tue, 27 Feb 2024 23:19:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709104778; cv=pass; d=google.com; s=arc-20160816; b=xg7C/7D6TQLalx41syBcV/WOFLoKHTfAboAROIUXBhGsmxQ24eFhTBQONlUadsMdom ysZSNrB5VnQIGO300HEhzZGlsHYLTkNu6KTXjQN3hnu4HwXkawbgq2vkteqEWZ4WjJ1I I2GmjeMpYrpHjNxdS/eqEZp8Lb7ZQV5oHUwaUvN1mxPfMAxQ0w1TUa6CMg13LwFeiUwE 1nmQn7I2beB7ERw6Kl3pja3CxRQQRPPdbGYnKevQuzta8ls/l638pzPp5tFZOFEmlZ6A VM2a3IcL1kEHbnnyaw0O48F61BloX3hD0Iz3jjpcyoMTxA+ovTl29JXzsdJNGZHE0YR8 1VXg== 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=fQ7mCshscH03zdPfSCxaRDMnzsL5ca+QWX2D+X24Uq0=; fh=tuqtLj9bcV8LZHOSyXk+i3wg411AZL3r2qySuZBb1hI=; b=MR/qNOS8atKDC6l4MNz7DaHxXqhwF3B6UkWMPO26khRghDeUWzjCshiR6E+SolHoXY XOV7kWDvqk7xc+YmB0BmNO4eFJNE0SyG4fkCvVkPyh435gq3HZabraMV5oFDmUPvDhwm 4BgV/xqYB/D85yyP9cJiJof/kHX9KEUBVWDTYanZUur2BaIXncJP56iU2AKpmu6gx21A hF4SazBcKyKIh+o55d7rjNqEKY59B+TIi4YgXJsYVfEuz47RHGkJZE2KWzasBm8b+moZ VjnXwdwQEqaJSQDoJ+JBTl56EA0+1R5p6ltiUlC3F1oZ2CVuceCLYuOOXDo267uS5zHK 0png==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6vxMFA5; 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-84592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h24-20020a17090acf1800b0029a1aaefe30si832069pju.188.2024.02.27.23.19.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:19:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6vxMFA5; 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-84592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84592-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5E833B25B6F for ; Wed, 28 Feb 2024 07:16:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4117124A05; Wed, 28 Feb 2024 07:16:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="f6vxMFA5" 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 770A523776 for ; Wed, 28 Feb 2024 07:16:07 +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=1709104569; cv=none; b=uQkYKsvUFL9Hqjwv5M13zv/1uk8qFBjlb2LqDWDQFrNlx7NIjU2fWa4yT2xQb1XStsx9SNFrA5OB/74tu57Ml4+Z2FuLkOYFejER+y+UUDb+dS7vkNGO3cOsfWZTJCJAIihguj5XVEltvML+frxlpzd/47qw3Sc4JnZ2E79D9uI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709104569; c=relaxed/simple; bh=kP6EhqgX4zAW40ee4Wjsq5nzeskS5lh4fQqG0DDbjjc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jLUWLu8Ew98bKp6b6/Vl7QyeY5uotklPrRYpDlC4nSxSH+PnRrAkrh7zLd3u56wLoisNuetGM+EyWS81ckPrFBNK3Nkbj+VGmroNgY5SgcnV6FyncmKhY9vERALDGL8Sm5xjZuDPAPFOJz9Kou+n1QLxW+3NCnOcdodiuh9Z510= 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=f6vxMFA5; 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-a3f1bf03722so564346866b.1 for ; Tue, 27 Feb 2024 23:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709104566; x=1709709366; 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=fQ7mCshscH03zdPfSCxaRDMnzsL5ca+QWX2D+X24Uq0=; b=f6vxMFA5yZizfP8brTU5TnuQ0YNXwo1iub09R5dfD1UdSpEnfttsMjGZyaVcxgQrU6 uwKCQZohvgtNvaRIJGpT38IXj+cdb91wGhvBVAk5E5vlenZ8ayAuza0uGp/IE1l3tm7/ nyBiLe9TrXPbe1pyMqSrHY6L8Am7duVApDi7yvJeaZJLK++K5K6C/YgSJIgXRQZlQU1G 5NGavRdTROE1glQDs0Mdkb1jFqeeBeiCZtVOIBFSQpDfFLfI93hGRGahhwvHrjzsJxLc Oq8433mtjiJ2JeDvuxHmT2PtGxIenMHX9cal9A6jWMs3P+a2b5QX1D4rqs0ACTzod3Nv v2QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709104566; x=1709709366; 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=fQ7mCshscH03zdPfSCxaRDMnzsL5ca+QWX2D+X24Uq0=; b=SCilp3r3ky904H/BPDdD0eXGl4Vz5+kCQC1mr2AeblVhsTdgvi7iUR8PQqKgPa2wdH iqbDGPzKie2kLgtjIPAExxgzKHMDY91QDe5zqtv617nnY9Gau8LGRjoXDALuxKVA09aT EYTQdwRYGaCVhK8kHTH1IY5DzPsRTvikOIgiENqmSABSNHnZbsVj4ZdOXZyKZpXEsXwi Z7/43YNAc5v3GS5IuVuOQCbr4FnS9qJNCjaI68I7LCVwg8gzAyTRv/NbtNiZMrpdOohC olwx+x6R7SdQy/8p5aWEnafEIdSa8nCEzuD4W5DbI5yt3Hei2wkOi04tuEMJCnHoGu3/ I0Sg== X-Forwarded-Encrypted: i=1; AJvYcCXNz3lT5iXtwP7E4jYkUU0Dit9LPdAsKttlu+Cwi6yjad+G1555qsZxjiMvjsMjU2EfXRi193hqMPPr6LUvM0yPM/Fry3kPBSw4apYe X-Gm-Message-State: AOJu0YybIvmudAPluAs7zVfkvoobOIBfYfWcBkOifuhNG79hn1miaZVv 683TLF6mIhE0qC/+ools297wucMwcUM6S9c7TQn1VMWfqXImQyXosJIKG8mRb3k= X-Received: by 2002:a17:906:b106:b0:a3f:d7ee:5fdc with SMTP id u6-20020a170906b10600b00a3fd7ee5fdcmr7810816ejy.46.1709104565879; Tue, 27 Feb 2024 23:16:05 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.116]) by smtp.gmail.com with ESMTPSA id tl26-20020a170907c31a00b00a3fb7cafad8sm1542085ejc.39.2024.02.27.23.16.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 23:16:05 -0800 (PST) Message-ID: <7f03bb12-0976-4cb7-9ca9-4e4e28170bdd@linaro.org> Date: Wed, 28 Feb 2024 08:16:03 +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 , Jonathan Cameron Cc: 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> 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 TNeBxJu5Ex0Izf1NV9CzC3nNa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HtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240228051254.3988329-1-dominique.martinet@atmark-techno.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. 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. > > 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. Best regards, Krzysztof