Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp59854lql; Fri, 12 Apr 2024 03:53:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUf3ZztSdBHp0pszW3GaZQAgQUcZ2HblKCI96VtvdnLX0qcXE6s9ZKHyjgU0oIdcpSQb80+UwZqdYpgyZ7feu5jGgSL3w4+b9wPyGTMtw== X-Google-Smtp-Source: AGHT+IFmifZOKiNGm681HFwjcONY+muIJPpoAmmgxp5whUu/Si93SmgJbO3eRX9GBNvA99yMx9d1 X-Received: by 2002:a05:6358:8510:b0:17f:56be:8c95 with SMTP id n16-20020a056358851000b0017f56be8c95mr2123382rwk.25.1712919206320; Fri, 12 Apr 2024 03:53:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712919206; cv=pass; d=google.com; s=arc-20160816; b=PSjUSJ/IiHDrwjBKeLKwgp/P06NwO4e5NnmpzuP/Ss/O+CO7707j70S5kQpJi8YFJz 9NaZPw5R5MAmB8iy/lS6z8I2faXh4EYOeQ0f1QykZtMFsd4PERnlsHEBW82ULC+93z2V HP/gfo7CuJ1W50DUB7l6P1CmgejhCM7O/JZWxOWLf+5GR7B1HpdhZoFmQwy3QcdDZ3uY /zxJbLr6SP4XG9YeuDUMRT9PmmDGUnFjbbIIo7uKoZe4LSCfC66zMg+dadXWUvuzf2GI RpfEIOMD7j1iyV1fsakIDxY+8B5QmYWtAMJ3mzgxQAR/Y4fU+LMXdn++TdF9Kj1w0Svq umMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=DqlenMfbXI7u4QjaxfgU8oCjAPQSIsIN53pM+qheFN8=; fh=0iT8RA8jtLscJH/MKK/CZH7tnxwINyQ/kVe9y6+qfqI=; b=sAcLFSIqt/7qEVwTCCWsXfnn9aB2x4vB/LoGYEZToCCwy+pqeOeamuWXHmvzeZi/xy ERQ3jUYBIXu7Lvf/2it9KmCmA2YHhpJK/wvhm+TRcFrVt3ctj3V5caE4XwmieSeuKKoZ mE1eUVSxDVTD9GuGblSBcG4j4emi06+qqucCL9gSWfMv1I7fPQvO90zFTBoAOMdIhL3e rFmrR9+Z5xar5u2AyTppA7XQqa5iNRcjy8sVUXXmIj55o/iVYVXY6BmnD1REOw27xVpw dX4zRZd2rjZEDUkkkGtHJ0IcLgANYzv5xfn1phx6cjDTZ7elNrNNB/e65Ut1ghjYkc4J YVDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wyYWXuPo; 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-142524-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142524-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k10-20020a636f0a000000b005dbdc9098c6si2953984pgc.445.2024.04.12.03.53.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 03:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142524-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; dkim=pass header.i=@linaro.org header.s=google header.b=wyYWXuPo; 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-142524-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142524-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1009228B56A for ; Fri, 12 Apr 2024 10:45:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A0143FBA4; Fri, 12 Apr 2024 10:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wyYWXuPo" Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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 AA52D41231 for ; Fri, 12 Apr 2024 10:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712918688; cv=none; b=S2khwhLy0TEWYaaaRfPrm/JT9NW+7dqaGVu0OM5KxSXCyy+EmLzKxuQOqUCgTo/fFCOA4qoD5cBGdv4IBAW/yC69Qe+JztWceTCaIxWgUDnHaAJYFx0jgTd0sN5tgK0r780Ul7cGAU+t9oZy37Y2tH8hd12uin47lsvddTZvDZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712918688; c=relaxed/simple; bh=v7mlEGcz7mNkeBpLcHL3FGgewkD7pRBBLfHoly2Kz5c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Content-Type; b=uVXTx+rMq1Zli7jdt3ome3JBp8enKBJWs7AXLhbigod6aLgLjELQgJHa+0XDaUKRP6DU15hIDxca++l+pPzlYrN/rhF9Rysa4Hh8jBPd0sJv1oegeTU3H8NSE6SA4KQq0z+JQvSe6ei5o2alkEnhqAVrdC9oloAS7UXMQobJOpQ= 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=wyYWXuPo; arc=none smtp.client-ip=209.85.219.179 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-yb1-f179.google.com with SMTP id 3f1490d57ef6-ddaad2aeab1so672303276.3 for ; Fri, 12 Apr 2024 03:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712918685; x=1713523485; darn=vger.kernel.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DqlenMfbXI7u4QjaxfgU8oCjAPQSIsIN53pM+qheFN8=; b=wyYWXuPo0dfDLuWrrgtKfwn0Fay1fwGgWeFjRyy4PXTqq653H7hxFiwZWFlcz2DXGj 1XdM53Gf2fZMDSWWvigysSpsCNcWgBuQ+0UMu8y0UUA3DLVbq8qK+h14YnZQR5UfgB/A aVTBMz7U6c+E0wpQY2CZlOeSZNMLfYhTpVgElP2NT+i+H+s9kBMq7HWFa62i05JWMG3K r/Lbp7qLBgJfo3TayokWWZM6V6USvBpDzHigpoB8uhT9JWdhX1V07PjOHr0ORK1ww8Mj Fw/cw/2X8J+3namHbLEz6ppXVietKBxAhFdunwsmrA4kC/8QcCQJFF2tRAPUtK5XRGzE QdEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712918685; x=1713523485; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DqlenMfbXI7u4QjaxfgU8oCjAPQSIsIN53pM+qheFN8=; b=iUjL7VQ+GguFKpE+R3NEC4QesVVF30EFFBZo0jM02XQ3HXCHCwIAdkLHEcP35eQXle rHdqhrYrcSRQTqj6xXUIdzJvCDgPJyMMLdqvyj33YH66D8N6L/NaxmlIjj9+wGaAucFV 4fR8HUwFvZ7M3DFsD9oy1bMQCuf8itRbACtl9MD1JaDaFzScIdKL2OgKeT8dfZ2Vrt3F sGz7C1HxKqw7NAIIIFv8/s55BXHF35Y6Od+r28wnQmgTvKHzPvwj2lUE5HX49EO2HAv/ uxiBAjfxOGYRo/iHVi7Jz8WunQCvxwfILxe8OizmWc+v0OC7jf+ZBXBzgztYg1xV6Zf3 EjJg== X-Forwarded-Encrypted: i=1; AJvYcCWPAyybAUmLx5Fj/12hMaqty1uXBvKXB6KRQ9drq8GRO2V+TYw9mgls+uUB61BAqdjcYAwHTnmmAmgvhlhD1Ic5QEuEZJrO5c1pe6Q3 X-Gm-Message-State: AOJu0YwQCu1A2Mz2A4slRA/MFRBiYqr75BxG9hjyIuM+H8QPx4HwSQ7K PH9LDRz9cVIlDzY1HAEBtqorXTyAv7Yp2PQQyAvTqvk1JO3QMUgmDiI2GgOtuKwPsdViv9G4RQl 4MTo6tkmFRqG2U7SaeH3nvITdvzpnq79r/zUZqcjOYx5IkbZ7lEY= X-Received: by 2002:a05:6902:252:b0:dc7:4b0a:589 with SMTP id k18-20020a056902025200b00dc74b0a0589mr2026248ybs.55.1712918685648; Fri, 12 Apr 2024 03:44:45 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Linus Walleij Date: Fri, 12 Apr 2024 12:44:34 +0200 Message-ID: Subject: Re: [PATCH][RFC][resend after bogus] gpio-syscon: do not report bogus error To: linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Etienne, thanks for your patch! On Thu, Apr 11, 2024 at 5:35=E2=80=AFPM Etienne Buira wrote: > Do not call dev_err when gpio,syscon-dev is not set albeit unneeded. > gpio-syscon is used with rk3328 chip, but this iomem region is > documented in > Documentation/devicetree/bindings/gpio/rockchip,rk3328-grf-gpio.yaml and > does not look like to require gpio,syscon-dev setting. > > Signed-off-by: Etienne Buira > X-Prefers: kind explanations over rotten tomatoes If you look in drivers/gpio/gpio-syscon.c you see this: priv->syscon =3D syscon_regmap_lookup_by_phandle(np, "gpio,syscon-d= ev"); if (IS_ERR(priv->syscon) && np->parent) priv->syscon =3D syscon_node_to_regmap(np->parent); So the driver will attempt to grab the syscon from the parent if it can't be located from a gpio,syscon-dev node. But it's not optional, look in arch/arm64/boot/dts/rockchip/rk3328.dtsi: grf: syscon@ff100000 { compatible =3D "rockchip,rk3328-grf", "syscon", "simple-mfd= "; reg =3D <0x0 0xff100000 0x0 0x1000>; (...) grf_gpio: gpio { compatible =3D "rockchip,rk3328-grf-gpio"; gpio-controller; #gpio-cells =3D <2>; }; So indeed the parent is a sycon, and syscon_node_to_regmap(np->parent) will be used to populate priv->syscon on RK3328. So what you could do insteaf of the kludge is something like: bool has_parent_syscon =3D false; priv->syscon =3D syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev"); if (IS_ERR(priv->syscon) && np->parent) { priv->syscon =3D syscon_regmap_lookup_by_phandle(np, "gpio,syscon-d= ev"); has_parent_syscon =3D true; } if (IS_ERR(priv->syscon)) return PTR_ERR(priv->syscon); Then when you get to the code you disable for the flag instead of: if (!(priv->data->flags & GPIO_SYSCON_FEAT_NODEV)) { (...) instead do: if (!has_parent_syscon) { (...) What do you think about this? Yours, Linus Walleij