Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp828671rwl; Thu, 10 Aug 2023 02:09:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaVVJ2F2ZXjyZE82gr+KpiPl23daFhLYXay4NjsW1DF5YhnB2GyIzFVre8csItmUuUoas9 X-Received: by 2002:a17:902:cecb:b0:1b8:9598:6508 with SMTP id d11-20020a170902cecb00b001b895986508mr2282331plg.18.1691658559625; Thu, 10 Aug 2023 02:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691658559; cv=none; d=google.com; s=arc-20160816; b=yjvbUqakcBBgHRKN6b5NZ6BFHNbqYHYyMjns7s+pr845iXSD5EvblAJ+rwZ2kKccgL lkRFoB5Ax3EA/TJmuDEys9VJ1XnHOZgFzXKyhNx4mrDWSzETLFfloDQex+8Ccn6z02xR M8t0LM+V3WCQDqAkDNHY7+7Js9/hEYvXYyHMirFqudZWgDQ5lskSbJv4FEgKLsjSI790 VdjB9kSKfjGC1H65J21Cf7Ylu1jN4LBflwSGCZmG7+yYkgQccK1H6cHGSwI24i1rEv1p Afvjy6jC7Aq8thtrND2z60++1f2JbbmUNCP5QtzNbm/mjqEgehhOdDFs+V6kt0w+R+yF exWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=j5CdkAgc0fdEPUHj9O82k/kTQ6xmErn6XcPLACwJvd4=; fh=QJiSLLsfka9yusloX3yR81YNIZYZfwWXY1AURZRTb8c=; b=xCPE5zeJIZop57KaPYbtqQgDiutlt55ulLy7wFgOs2wSujkTl2v6VtYYqbb22QJqO7 gR6eygelhWfgMutA142Ueiw8J9doMza7jgU6SVGbK/0c58g3Da/FDOBP4BPm5OftaoEx KBzkXMvIhB95TlDGDNG6lu8pV8QCrl7/LAEmQZovvM8xHhOLbama+cwqjcpeSCw/VMR7 lvARSKLyyP1Ms2IvMv1M9cUcn4kXikfM5vW8JJtb8qKSisGj/N8pRlUMlHaCAbz42eRC OKijpWmLtgMWzT6xfK1Dy0ERzb47aRkdh3TZNgHVeMPwv4ylJS6wn03GLlPGD9LzmTfd DIlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmI5rBV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a170902e80f00b001bb23874273si1106079plg.220.2023.08.10.02.09.05; Thu, 10 Aug 2023 02:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmI5rBV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjHJI2N (ORCPT + 99 others); Thu, 10 Aug 2023 04:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233017AbjHJI1x (ORCPT ); Thu, 10 Aug 2023 04:27:53 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E185AED for ; Thu, 10 Aug 2023 01:27:52 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-586df08bba0so8306677b3.3 for ; Thu, 10 Aug 2023 01:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691656072; x=1692260872; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=j5CdkAgc0fdEPUHj9O82k/kTQ6xmErn6XcPLACwJvd4=; b=mmI5rBV7acGNfMX6damE4Hc4jPx7mptZ5eZ8BGglfS1X1ka42HS87UoWx9srEaNoGB e9po/52U3cUphRowfFlI8/YN01DNCqQ6h7JZUXPTmB/N/H7lp9X9Z58o+xmccQKdKp68 wELs5YiObeLXvwGHohzfT4SxFVBuFigbj4dc/oOUwntm5pyi965C5j1STdSZBb0oqWsl odkoFYbpX0AspgsAwNQ2Gx/z2Eh7jQBrApkByPf5j2OefI1FN4GkYZK7KLjlXHkClTrb Q467PZrDkk6OYv8eiENREdRNzHxYPdQfDoKMrfOU+YU4A7uM3XKBp9Xtsk2L02TZR1HR qcaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691656072; x=1692260872; h=content-transfer-encoding:cc: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=j5CdkAgc0fdEPUHj9O82k/kTQ6xmErn6XcPLACwJvd4=; b=C1rZbIPyYGYplVk/ThCyh3Pp05bGDpQYFxPKhGrH/573c56jq3g2IyaakTJ7lxw6VU R2+p94J494ascZYJmamcIiT5o8AwDr3061yLdS5u0pgbygHPO4KGkDSmSylbylmxZTQd dYCGpi/G07WGhiT+70w1tl5vdbyL/6VfZQ8wI6FBCrZM+qQNCMXy4ets5o1qyHnrT8hz JpMRFv2mOT9xKZGWB2vm9JvbTyR1YPhiOknwPeofsXTG+9mEC4cciEYPdSArx7xbt3I4 lsI9SbcKyrLfxlBc+jH/lZv8ZQLEhKMsp40jiZyjlfXU//vRuljiOECFZoNsWuUuGM6c UHyA== X-Gm-Message-State: AOJu0YyjHjs/xotBzLZHaCpO90mSxH+UWnYORrcwAPIw6TNuDuL5Stnq ronbdXuVkNwi9FE6N9DZqgzeCQHKgg0hyC2WQGFRXw== X-Received: by 2002:a0d:d4d0:0:b0:589:8b55:f8cf with SMTP id w199-20020a0dd4d0000000b005898b55f8cfmr1680900ywd.50.1691656072168; Thu, 10 Aug 2023 01:27:52 -0700 (PDT) MIME-Version: 1.0 References: <20230807074043.31288-1-zhuyinbo@loongson.cn> <20230807074043.31288-3-zhuyinbo@loongson.cn> In-Reply-To: <20230807074043.31288-3-zhuyinbo@loongson.cn> From: Linus Walleij Date: Thu, 10 Aug 2023 10:27:41 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] gpio: loongson: add firmware offset parse support To: Yinbo Zhu Cc: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jianmin Lv , wanghongliang@loongson.cn, loongson-kernel@lists.loongnix.cn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yinbo, thanks for your patch! On Mon, Aug 7, 2023 at 9:41=E2=80=AFAM Yinbo Zhu wro= te: > Loongson GPIO controllers come in multiple variants that are compatible > except for certain register offset values. Add support for device > properties allowing to specify them in ACPI or DT. > > Signed-off-by: Yinbo Zhu (...) > @@ -26,6 +26,7 @@ struct loongson_gpio_chip_data { > unsigned int conf_offset; > unsigned int out_offset; > unsigned int in_offset; > + unsigned int inten_offset; Consider just changing all of these from unsigned int to u32. (...) > + if (device_property_read_u32(dev, "loongson,gpio-conf-offset", (u= 32 *)&d->conf_offset) > + || device_property_read_u32(dev, "loongson,gpio-in-offset", (= u32 *)&d->in_offset) > + || device_property_read_u32(dev, "loongson,gpio-out-offset", = (u32 *)&d->out_offset) > + || device_property_read_u32(dev, "loongson,gpio-ctrl-mode", (= u32 *)&d->mode)) Because then you can get rid of this annoying forest of cast. I'm fine with doing this change in this patch without a need for a separate refactoring, as it's just a contained driver and clearly just about typing. Yours, Linus Walleij