Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp564178imw; Thu, 14 Jul 2022 06:47:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNPQt9UA3Qh19jcDjFuGUFnSOm6cQNjVhS0YelJyiadUcrMWE0ePnwP6YipYPvu1OmMJGb X-Received: by 2002:a63:82c1:0:b0:415:d42c:1653 with SMTP id w184-20020a6382c1000000b00415d42c1653mr7615817pgd.334.1657806453129; Thu, 14 Jul 2022 06:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657806453; cv=none; d=google.com; s=arc-20160816; b=Ufk+B85NFm0HcZidHp1DAX4J79lp7BFDw6i36/uvH0GJ60RwBYtjviq9gpS4j5MqeI iW36cXsgcbu2gKA+xrvF2jAMOKQpSBzRdC3yHUi8gVnRXjZK2L5Qf+LLQeKt0huiuucS XkxF1ypI5/wkCIwGa3l8eLkh4tlS+JcltWGajRdsSF3kIdzFsx80H1svauAcy7V5E7Kl Bplqg2nvjOUmbpZYLjsLbKxRgDWvytj3ezihrhbZgVE1gKtcKZlFqIDx92vRkiUE3rkd Gkg3Ba/kSppYe/f49gP5+E8uFb2U4vlLGHKOdVNUXas6M8wbJCzVdsHOzNX8XDlXCBSV 0C+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:subject:cc:to:from:user-agent :references:dkim-signature; bh=r5do4LnFwTokZvIPYH67sdVqBxuC9hwNdZWgHvV/I7Y=; b=aCJYoz1zYMIpgSbF4owxDzFSHYwhoeK6h9FQKsfneXo1HA7v2ErLmdhwg3P5tVTHzO nWk4oXMVbBh+qRTFaq6qYftpPNerxTpUheGQr3jBbN4FHs9hkJHuFFmrW+9UStvW5Wlx GCVMnF4DNMqCeN8I6yp31dFoZrpzTFMxTV6nsNBIJ+T09hqZ3LqKK2ZSJcaeFwklmILx R8mQGhP0eUB8hrpntnkbrZ2A3kcqcZs4bjWwUp+9meCmmMuF2LKtGU4ALJpjKIry+sOF i5u+JO0AWNOiGY1tYEcdbDcVGq7xb/dAUOlOxVBJRon5mIw6Hg8qgi5sB5DEZ3JUw+Pq KAzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=MrTieGt7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a170902da8500b0016a2a8d3690si2343176plx.189.2022.07.14.06.47.19; Thu, 14 Jul 2022 06:47:33 -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=@tkos.co.il header.s=default header.b=MrTieGt7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239101AbiGNNTw (ORCPT + 99 others); Thu, 14 Jul 2022 09:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239609AbiGNNTo (ORCPT ); Thu, 14 Jul 2022 09:19:44 -0400 Received: from mail.tkos.co.il (golan.tkos.co.il [84.110.109.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C615D0C6; Thu, 14 Jul 2022 06:19:43 -0700 (PDT) Received: from tarshish (unknown [10.0.8.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.tkos.co.il (Postfix) with ESMTPS id AB87F440F68; Thu, 14 Jul 2022 16:19:20 +0300 (IDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1657804761; bh=rC0OqKZ10lqLln3fBLyz//cFKspAfwxL4UXaVjVi8XU=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=MrTieGt7XR0JWNrlhEggY6RFpCNTkj4S/I29D/r7E9iLRoiiNEjgQw8yvijyGUY18 USwelBx/a/W0eH1BaP1mzhtFoM9EGuDIkyQdwKwH7qQFtHooAFVTAkQSU6Nc+jVVkM XTerN+TiDMSh98lyFqFChgc5phW+3acfas1dwnG8BDaaQsH0Y6dVmCULYnlDgSSUGF n70TM89gabXhe2/ccNloA4yxCXHBI7WYa/82TCDja8IbKO+p3UOwH50XvzjcbJeL1c xtOXwehx2xeSIwpMNT+0h9FfXyONjU4gbsY8wNl8dUO7GlHNyoaFZurmpxRm0YhQcW WuYOR6YQikoEQ== References: <20220714115515.5748-1-pali@kernel.org> User-agent: mu4e 1.8.2; emacs 27.1 From: Baruch Siach To: Pali =?utf-8?Q?Roh=C3=A1r?= Cc: Thierry Reding , Uwe =?utf-8?Q?Kleine-K?= =?utf-8?Q?=C3=B6nig?= , Lee Jones , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Marek =?utf-8?Q?Beh=C3=BAn?= , linux-pwm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/4] gpio: mvebu: Fix check for pwm support on non-A8K platforms Date: Thu, 14 Jul 2022 16:14:27 +0300 In-reply-to: <20220714115515.5748-1-pali@kernel.org> Message-ID: <87lesvde6s.fsf@tarshish> MIME-Version: 1.0 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Pali, On Thu, Jul 14 2022, Pali Roh=C3=A1r wrote: > pwm support incompatible with Armada 80x0/70x0 API is not only in > Armada 370, but also in Armada XP, 38x and 39x. So basically every non-A8K > platform. Fix check for pwm support appropriately. > > Fixes: 85b7d8abfec7 ("gpio: mvebu: add pwm support for Armada 8K/7K") > Signed-off-by: Pali Roh=C3=A1r > --- > drivers/gpio/gpio-mvebu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c > index 2db19cd640a4..70a22b68c034 100644 > --- a/drivers/gpio/gpio-mvebu.c > +++ b/drivers/gpio/gpio-mvebu.c > @@ -793,8 +793,7 @@ static int mvebu_pwm_probe(struct platform_device *pd= ev, > u32 offset; > u32 set; >=20=20 > - if (of_device_is_compatible(mvchip->chip.of_node, > - "marvell,armada-370-gpio")) { > + if (mvchip->soc_variant !=3D MVEBU_GPIO_SOC_VARIANT_A8K) { The 'if' condition that follow the 'else' below become always true: } else if (mvchip->soc_variant =3D=3D MVEBU_GPIO_SOC_VARIANT_A8K) { I would suggest to keep the '=3D=3D MVEBU_GPIO_SOC_VARIANT_A8K' condition, and reverse the if/else order, because positive logic is more readable. There is also another 'else' below that is dead code with this patch. baruch > /* > * There are only two sets of PWM configuration registers for > * all the GPIO lines on those SoCs which this driver reserves --=20 ~. .~ Tk Open Systems =3D}------------------------------------------------ooO--U--Ooo------------= {=3D - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -