Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp70080lqj; Thu, 11 Apr 2024 10:03:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmmoYo6oPow8k0FqjLiJ3Iign2htakDc53xXvT6OfAJkSc2f0UZ4WGJRxeleAC3h3jhqMEHWzwcFaaEueUNqSAK1C9Is5wmPmxrBPEyg== X-Google-Smtp-Source: AGHT+IHAGvZCbV8tcNRlfaCvLXL/42pS2kskcTsYjjmUZ7G4Oa8WYh7h22ZomN03iRNZNw38WPWG X-Received: by 2002:a05:6a20:978a:b0:1a3:c3a9:53b7 with SMTP id hx10-20020a056a20978a00b001a3c3a953b7mr386259pzc.55.1712855033344; Thu, 11 Apr 2024 10:03:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712855033; cv=pass; d=google.com; s=arc-20160816; b=RE7PUteeU/zNOXyQeoSrkm7Jzskfc9o/no5zJse5SA+VqLDzw8ZqSoZtt4ueS/LCxk pgWBnecTvC/5AAgpkKdPyUnNw3+ZI7oRk3R3p39IHSF+rbJBEwbwNahWVWIxqMvIcDYP d0pGtph2KGYY4LgZ9gcmAibr6SVoMcQokyjmcLnqXissrqFDtC1Sf1ujWrwmGslel7JL 1gD1K9Cio7y7UcJeTQk03595NPLPiuCBskIdNh5eKsvQr2w3cMtHyCYT7HadMHaz5M9O k7hl9AwXRaKMQqPyx9ZJphiF9o+NTeuh++WBBL6S3UM0AYXQIQXiFc+fV7K0fzXty6NK 07iw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:mail-followup-to:message-id:subject:to:from:date; bh=ts7ot81DqcN0+ON3qnCvLVIS19Ci+eAo8lejVvdojr8=; fh=SteCe9Gyzxrky23ih4mb/KrkACPtVyANMnx1GMFn/rI=; b=Pqbh5xEscaJ9EdsEB6PDT7bJi/TrWpK6sDVsuJD/u4PP6CrbDLSRJmm/3afysuuy9w EW8yLtgufVvNKytTZi8gg/TBMWQw8zj1Ix81M8W4jxLTRT23HW75iAzKXr3Dq5yUgAN/ R5RPamHsJPNWO/3BolAqpC7emTP/PPS5fnsadTfcIq08sKszkBT7B/gb7Mb39seJHvI5 kDextrR57pAzi7h4NH0de/DSiOLTnNUZr6T8fzeRvFEWaEyN0x3S/NQU7zig3sKamx/F zr4dh072BJCBxXngmjW0adv65vclXW2cYdEZEu88cBVaY22qZKv4fSvRzDg3p8j23AEu aZFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=free.fr dmarc=pass fromdomain=free.fr); spf=pass (google.com: domain of linux-kernel+bounces-141145-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=free.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u6-20020a056a00098600b006ea8b233549si1665053pfg.328.2024.04.11.10.03.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:03:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141145-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=free.fr dmarc=pass fromdomain=free.fr); spf=pass (google.com: domain of linux-kernel+bounces-141145-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=free.fr 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 0955C28D41D for ; Thu, 11 Apr 2024 17:03:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F0651EECBF; Thu, 11 Apr 2024 15:41:56 +0000 (UTC) Received: from smtpfb2-g21.free.fr (smtpfb2-g21.free.fr [212.27.42.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D29FE1EE291; Thu, 11 Apr 2024 15:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.27.42.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850116; cv=none; b=el7rT4LJ/udDMUSfVz176+VPijTuUkCHSR0DIKDeFt5YOv3n2b/wwrtnlEIggES6v6Ezzz0Klp290VAsU+jMdxRCeBtG2bqpvPiYRew2hwyUZsrbf/QH2ZbCt1fjErqeViIRgRhEDMyd452QUrvvurupquxEPY7/Mz7wUvh66CY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850116; c=relaxed/simple; bh=sdve3zvrGeQnGmwpoWkNGk88ZE0iuKbJSVfpS5ImZi0=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=eG17ohzook5dyw3NTiTpwe/6Hl+SNhNfuATBtHWEt8uvNwTquCl+WWKKCh2+jzcB+NyrmdNka86gBJSQrpZNsNAzvLRVkdCGMgrHeRnT7dNzQcb2k7bolSYWCRwv3bTDLxoHTklkWvfvUpc+79x7cfq5gGux/Ag+d7n8ttO3bug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=free.fr; spf=pass smtp.mailfrom=free.fr; arc=none smtp.client-ip=212.27.42.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=free.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=free.fr Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb2-g21.free.fr (Postfix) with ESMTP id 924F94D70E; Thu, 11 Apr 2024 17:35:36 +0200 (CEST) Received: from localhost.localdomain (unknown [82.64.135.138]) by smtp2-g21.free.fr (Postfix) with ESMTPS id D66822003CA; Thu, 11 Apr 2024 17:35:24 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 2369040039; Thu, 11 Apr 2024 17:34:32 +0200 (CEST) Date: Thu, 11 Apr 2024 17:34:32 +0200 From: Etienne Buira To: linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][RFC][resend after bogus] gpio-syscon: do not report bogus error Message-ID: Mail-Followup-To: linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org 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-Disposition: inline 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 --- drivers/gpio/gpio-syscon.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c index 6e1a2581e6ae..14c4f224eb07 100644 --- a/drivers/gpio/gpio-syscon.c +++ b/drivers/gpio/gpio-syscon.c @@ -16,6 +16,7 @@ #define GPIO_SYSCON_FEAT_IN BIT(0) #define GPIO_SYSCON_FEAT_OUT BIT(1) #define GPIO_SYSCON_FEAT_DIR BIT(2) +#define GPIO_SYSCON_FEAT_NODEV BIT(3) /* SYSCON driver is designed to use 32-bit wide registers */ #define SYSCON_REG_SIZE (4) @@ -27,7 +28,8 @@ * @flags: Set of GPIO_SYSCON_FEAT_ flags: * GPIO_SYSCON_FEAT_IN: GPIOs supports input, * GPIO_SYSCON_FEAT_OUT: GPIOs supports output, - * GPIO_SYSCON_FEAT_DIR: GPIOs supports switch direction. + * GPIO_SYSCON_FEAT_DIR: GPIOs supports switch direction, + * GPIO_SYSCON_FEAT_NODEV: gpio,syscon-dev do not have to be set. * @bit_count: Number of bits used as GPIOs. * @dat_bit_offset: Offset (in bits) to the first GPIO bit. * @dir_bit_offset: Optional offset (in bits) to the first bit to switch @@ -149,7 +151,7 @@ static void rockchip_gpio_set(struct gpio_chip *chip, unsigned int offset, static const struct syscon_gpio_data rockchip_rk3328_gpio_mute = { /* RK3328 GPIO_MUTE is an output only pin at GRF_SOC_CON10[1] */ - .flags = GPIO_SYSCON_FEAT_OUT, + .flags = GPIO_SYSCON_FEAT_OUT | GPIO_SYSCON_FEAT_NODEV, .bit_count = 1, .dat_bit_offset = 0x0428 * 8 + 1, .set = rockchip_gpio_set, @@ -221,19 +223,21 @@ static int syscon_gpio_probe(struct platform_device *pdev) if (IS_ERR(priv->syscon)) return PTR_ERR(priv->syscon); - ret = of_property_read_u32_index(np, "gpio,syscon-dev", 1, - &priv->dreg_offset); - if (ret) - dev_err(dev, "can't read the data register offset!\n"); + if (!(priv->data->flags & GPIO_SYSCON_FEAT_NODEV)) { + ret = of_property_read_u32_index(np, "gpio,syscon-dev", 1, + &priv->dreg_offset); + if (ret) + dev_err(dev, "can't read the data register offset!\n"); - priv->dreg_offset <<= 3; + priv->dreg_offset <<= 3; - ret = of_property_read_u32_index(np, "gpio,syscon-dev", 2, - &priv->dir_reg_offset); - if (ret) - dev_dbg(dev, "can't read the dir register offset!\n"); + ret = of_property_read_u32_index(np, "gpio,syscon-dev", 2, + &priv->dir_reg_offset); + if (ret) + dev_dbg(dev, "can't read the dir register offset!\n"); - priv->dir_reg_offset <<= 3; + priv->dir_reg_offset <<= 3; + } priv->chip.parent = dev; priv->chip.owner = THIS_MODULE; base-commit: 4cece764965020c22cff7665b18a012006359095 -- 2.43.0