From patchwork Thu May 23 09:51:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 164952 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1951634ili; Thu, 23 May 2019 02:51:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr/i0z9epA0dBa4dNN0AsmtncsUKWqm9fEF6bSg9JXQ6RyzcHvV5M7vChL+uBkNN5ZW93m X-Received: by 2002:a62:3741:: with SMTP id e62mr7571023pfa.213.1558605087000; Thu, 23 May 2019 02:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558605086; cv=none; d=google.com; s=arc-20160816; b=Il8+hlUG2ZnHSr5vcrRrROcur0aC1KneMZ/YbsH9hoZDNU/+SeLPYxkRsYIwMphawW ot5jpF10WUfe20lXQPlEI3WkQuN656z5xBIechYYeq88FJ7hiE71Hs7I9Zx9vO1ow01F DqWmbM23XWudYjpjT0p9R7qJFS8XGsbyJ/WixKCOhcwsdLheBIovUWSlSCy14Hl55/cY Lor/5dgUK0T3I2Zt+kGrB54H60TXg7E50JCJoJt4G+3nah/3D4gaWQiIj87NXrdQGkTK 2adRIDstVnfPAb90iL7RqoUHa00mR/bZrWMW0teHf//7tHqWm8XIS1hEy2N+Jyxs79yz V3KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TYaapiuktWji+ZLrBkHMS37YDS3FOPH9F6n5Ia6NopU=; b=GnJ0yjZfkMPLiYopzVV14SzIVwNf+SrZgorGbS3+i36BEPfJoEiefsGUw9f2rxaWR5 oijlGF7Wv9Q9NxPhgqBHdCNBeExOQi0iwsKFPk5Rl2D1o9MNIRmu0mAXvdB0dRWT+x5g XLoHxcG/7JVjUzb6iFmD4GcU13DLbl5ZcvWGko3xVhKFANi6VvT6MAAK7HlFwLePWy8M NxK1cHnAWFbe32l++7Zs/tGHgqBBGIPigH/sgDDZqdLxMqaQlY9R6K8QDAwRXZ0YR5dI h98n0XSF+kn2xybnvWk00YXHJA4vjwn+offF3PclvLNH12uM7zYsQXDJ6Rjnj95se5kX BQhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKzf2iDq; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si27422077pfs.242.2019.05.23.02.51.26; Thu, 23 May 2019 02:51:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKzf2iDq; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 S1729698AbfEWJvZ (ORCPT + 5 others); Thu, 23 May 2019 05:51:25 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40166 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727440AbfEWJvY (ORCPT ); Thu, 23 May 2019 05:51:24 -0400 Received: by mail-lf1-f65.google.com with SMTP id h13so3923044lfc.7 for ; Thu, 23 May 2019 02:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TYaapiuktWji+ZLrBkHMS37YDS3FOPH9F6n5Ia6NopU=; b=TKzf2iDqswc0LSUvoxXVx9v9IIeFK1+m/wTS+tpORFlyvWIIPkbHqPcLQA/xMJ9675 orMrCeX696bO1ppZJF4IFxIpK7eptODW62JC6pxeE4aNkzuD1kuHBIdp/mnHI1aMATb9 OiW8eqcNZTI6eonmhVCRW/YY9C4/5h5bGNUV5D+okztPv/VDG/uAGPbzXHaj8PmOY3ZY E/iL5VK6naH+JKIPU4jxeH1JzyJmTeTrmiZ+Am83RTABB+7VK4tk7gPwzBZgcc5LYvNP cTZCRALRxwsiuyK+wR6Ey/dB0i3kH9sVUUO/4BenyPF6jil6Rn6MBA8PGPcq8S8cAwmA tJtA== 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:mime-version :content-transfer-encoding; bh=TYaapiuktWji+ZLrBkHMS37YDS3FOPH9F6n5Ia6NopU=; b=r1Q4paLpldby8Cn7nlxd5E/sGUAlbAkvHbYEBElW8/akssas/hpRevlJaKnjXqxuiz v8Mnmd6lYSPisJRDYtBkfu+dUCjsMu4VOPbsl9O17mhztsazyjqzox4AhZ60da8o8Uay 7pv8YKwWVFOl9xbMz4peKzXPA7/IStYfIy/Y+171pM/PS6Da5glFG7HrcnQDssYwE8cN 52SJfOX7kJASQqBs1RPzBBS/cvf5D2psnXeCit0zR9cYk6BVVohLC3uulTIREfX65kRW OiZNAnnyN890t0bHHmgo0a7i07eOmCGOHW60Xtq6iJpQKGhYWVMvnTUF+V4KeU8PaAkR +BAQ== X-Gm-Message-State: APjAAAUomL/RBU7P62zs65OPYPhxEcQFbC5Re2e6Gny4Z+efY8VqpZpb Hp1pzV13twh+PpgmEhG9Up2BqfwJltQ= X-Received: by 2002:a19:c20e:: with SMTP id l14mr2857058lfc.5.1558605082232; Thu, 23 May 2019 02:51:22 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id d10sm1041589lfn.91.2019.05.23.02.51.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 02:51:20 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Brian Masney Subject: [PATCH] gpio: ixp4xx: Use irq_domain_translate_twocell() Date: Thu, 23 May 2019 11:51:19 +0200 Message-Id: <20190523095119.31967-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Use standard functions. Eventually we will be able to drop all checks and just assign irq_domain_translate_twocell() to this callback. Cc: Brian Masney Signed-off-by: Linus Walleij --- drivers/gpio/gpio-ixp4xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c index 4b1cf7ea858d..670c2a85a35b 100644 --- a/drivers/gpio/gpio-ixp4xx.c +++ b/drivers/gpio/gpio-ixp4xx.c @@ -205,20 +205,20 @@ static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain, unsigned long *hwirq, unsigned int *type) { + int ret; /* We support standard DT translation */ if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) { - *hwirq = fwspec->param[0]; - *type = fwspec->param[1]; - return 0; + return irq_domain_translate_twocell(domain, fwspec, + hwirq, type); } /* This goes away when we transition to DT */ if (is_fwnode_irqchip(fwspec->fwnode)) { - if (fwspec->param_count != 2) - return -EINVAL; - *hwirq = fwspec->param[0]; - *type = fwspec->param[1]; + ret = irq_domain_translate_twocell(domain, fwspec, + hwirq, type); + if (ret) + return ret; WARN_ON(*type == IRQ_TYPE_NONE); return 0; }