From patchwork Tue May 30 12:28:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 9754489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12B39602BF for ; Tue, 30 May 2017 12:29:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 042572847B for ; Tue, 30 May 2017 12:29:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECAB72847E; Tue, 30 May 2017 12:29:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 787902847B for ; Tue, 30 May 2017 12:29:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vl38zmXYGF+xdYVf+9mAWX7lyqJpqullPM3rJwGSuiY=; b=fM67qvJ6ZgJ3CS9Clb/ggEW3D6 m2j09H0Efr7/oTEOKPsEUYG3kFqOlAlvaXN7orIWb5b7ToYy8hs4zvYgv1sAYrPhgub54vMCouwV+ YnphF39wGIlwkWBtIU2ngAEBHsvopJxqkBPe3GZf+ELlTaVgUQudQQQ7LIdCh9kH5cw+gS/hV2agd OAeLRN5dhOypcuTcvZUQdIGEM0FjqzwoKIZ6W+ZsToXO7ECUxTcsC36C+8jaci5UhHXdiSDT2nucI orFB2tw+KpCWFDErPIF5lUxe6z4pOZ+dhzkWLzRuYlp09LO34CkrPdrHz8fxg7W/mjYbsUAZxMdN/ +nx0S0uQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFgHS-0002Qn-IM; Tue, 30 May 2017 12:29:46 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFgHG-0002AY-FL for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2017 12:29:36 +0000 Received: by mail-wm0-x242.google.com with SMTP id k15so24992851wmh.3 for ; Tue, 30 May 2017 05:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EZ0Tx5HF4qwgPW6eKw11/mR40wwBiUqocb1Y+5jKZy0=; b=Wd6C2dkuKoL6WtkoOT6TzVp4f+1/RzPWqdJh4mr1fT4qRLfqryty3Iyqch2TviqIuA 7VzJlPpfSXdFrYddgvdYzQiu7DZCV/+gnH+VU3HpRZw9hZz3xf3UUAkF7IXuWjEd1qod ilr9QUGg/CZV3HkQrbH4Dz4535H2vWppRlKJqL9+bHOrgemn0+fSv50zrP9LCjyN6SyO c7ZvHBaiAevRN+ovBtYIWjZ1Sn9WmP2i8v18UjLP+xv9VxSuBfj+xDeNBDyaO/JyJx4V PxDU/0UejPz2adgkUNwxbEtykPaxByIR91/f2iaIMwuTC3lMK8l6jL5G7etsUbOU6xL0 EHyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EZ0Tx5HF4qwgPW6eKw11/mR40wwBiUqocb1Y+5jKZy0=; b=B79waNAf8hu3g3x7T5i63Nak9q9WpHVDvfs79L7n+ObyHo+jjUe2KRBjKz4fJn8qIn ZNzph8T2hLs9evFELBsZ/OFiDaJK293apX3oydQVtUMmlsIiVWfmXHbiRMtNVmKPefVK paZJbT1iJ42pEDnDRRlOYCPVB30qg7ovJgPl7m/sH3FTu/FTm28sTUJ5RCUzPLf1bqJE yJyuI2D2MAg3UAq16Y0ce4JXfwEOo9KT16ehdCprfdUoTiYMp5dtja0ALhL/m1JWyrf9 mDEmd/LOaE5M0TSnTmrNr6I1eQqiztBWe5q06GxysgYf5fvqkMQdDc042uXAIEzwZthy lyKg== X-Gm-Message-State: AODbwcBQwvbNViPNXJACxW1NJdfRzG64EF2AlsYr5KrWMYe5YpIn5CZH bXWIDFVZ8dswow== X-Received: by 10.28.210.5 with SMTP id j5mr1494344wmg.56.1496147352184; Tue, 30 May 2017 05:29:12 -0700 (PDT) Received: from localhost ([46.227.18.67]) by smtp.gmail.com with ESMTPSA id l190sm17555936wmb.18.2017.05.30.05.29.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 05:29:11 -0700 (PDT) From: Richard Genoud To: Linus Walleij Subject: [PATCH 2/2] gpio: mvebu: fix gpio bank registration when pwm is used Date: Tue, 30 May 2017 14:28:48 +0200 Message-Id: <20170530122848.2803-2-richard.genoud@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170530122848.2803-1-richard.genoud@gmail.com> References: <20170530122848.2803-1-richard.genoud@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170530_052934_735572_1DB97662 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alexandre Courbot , Jason Cooper , Andrew Lunn , Richard Genoud , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, Russell King , linux-gpio@vger.kernel.org, Rob Herring , Thierry Reding , Gregory Clement , Ralph Sennhauser , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If more than one gpio bank has the "pwm" property, only one will be registered successfully, all the others will fail with: mvebu-gpio: probe of f1018140.gpio failed with error -17 That's because in alloc_pwms(), the chip->base (aka "int pwm"), was not set (thus, ==0) ; and 0 is a meaningful start value in alloc_pwm(). What was intended is chip->base = -1. Like that, the numbering will be done auto-magically Tested on clearfog-pro (Marvell 88F6828) Signed-off-by: Richard Genoud --- drivers/gpio/gpio-mvebu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index cdef2c78cb3b..4734923e11fd 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c @@ -768,6 +768,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev, mvpwm->chip.dev = dev; mvpwm->chip.ops = &mvebu_pwm_ops; mvpwm->chip.npwm = mvchip->chip.ngpio; + mvpwm->chip.base = -1; spin_lock_init(&mvpwm->lock);