From patchwork Wed Aug 29 15:05:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145443 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp787481ljw; Wed, 29 Aug 2018 08:08:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbglnffW63G/ICmkBrH3565qMFEWBxMKcISBJDg5DyCvf1ll9HMLcDMdxuEoIUG15c2EbE+ X-Received: by 2002:a17:902:988a:: with SMTP id s10-v6mr6177509plp.200.1535555283434; Wed, 29 Aug 2018 08:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535555283; cv=none; d=google.com; s=arc-20160816; b=PY4DlK2G6+8wci14I6mg5JV8/eBSaRLi2PtjVzRgp/TsOfvV2oWxMEpmHG9+3mo/+5 AHaUMnsHn8dxB0XL+/saKonax2AKh+zvYnAOtciPJmf0CYkV473w6hEL35FDA3wrGPgQ xkfh57TOua9WaR4QGgXLcCBKPcIdB3vgRJGUy8bKTzz3S5+ftizuZ2o4DUSGmK0MSbq9 Gl/KSns9rEBeYtcMuxBs8CMQzhKUvuOvowf2Xhk1PrvXBr6trl6RXpvmVSEq5uYQflqC H4ZAXxVqT45s2V8mDok8ekplDzDoAIDlCFMc0vIOQM73gddYEHw6obj6aEXFDOlyKcSo qZ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=tdKMHT1UOQLm4SNVX46Crjtd8lUqUHOHwQMNOviI0Ys=; b=kz5UTXBssTRR34I9EJpF2/odyNsIvnHtG6C1xYx73PfbVeGes2KLJA6k/atMxpbxOi 3DA5Hv/6l2WInH5NIQZdxOlqRObAMUBPbOSiF6YhHQp2teJjjKp0zVt/V1xnasts74UD /kQtiPGIJW0urKzssDw3xk/BUFYkFolZWgFGIR9FoYz32nvrqmIWLaQSjxPS1uQCJ1Pu hFJC6ZQvvpMvbCz7LvWOk8AXXd2zd/s6HWzR8L5va+Ma0RRUAptTtXQK4rG9cOlPa6eq LeSU7I+eN/Y5K4aTGsXwgpwLzr3F5bmys6sYFarBs5h1xWJuCQkb2uPtja5DJz1oABeK v6LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ef09J6eP; 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 f127-v6si4163701pfb.290.2018.08.29.08.08.03; Wed, 29 Aug 2018 08:08:03 -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=ef09J6eP; 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 S1728062AbeH2TFZ (ORCPT + 5 others); Wed, 29 Aug 2018 15:05:25 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37293 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727668AbeH2TFY (ORCPT ); Wed, 29 Aug 2018 15:05:24 -0400 Received: by mail-lf1-f66.google.com with SMTP id j8-v6so4584765lfb.4 for ; Wed, 29 Aug 2018 08:08:01 -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; bh=tdKMHT1UOQLm4SNVX46Crjtd8lUqUHOHwQMNOviI0Ys=; b=ef09J6ePgolB9wzDcmA1gKW2yr7UrzUh9IBnuj48ztXSLPAX2U+gOHiLVsJ07z5sZR MPXob7ULtetykEMEvTyc7rTRoFbvSDpCPmFcNthTB1jv82fXNqSSAcycYR3f/rtc2ya5 KSLW7WrU8xhKXD3ILceEUYDnt9lApun+vNTcg= 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; bh=tdKMHT1UOQLm4SNVX46Crjtd8lUqUHOHwQMNOviI0Ys=; b=pXqm6X8Ay3YI+pCVIA5rOI7ojmtDJaFpx5j39pRygdHbZ0vF6OFHEoUD9bva2SMRLb EcPqwWOXTc/SG3iBxLC5rL5iNN40FtVUYvts+JD481rCa+RlpyAK4AsBsJBxR2lwB0HF Hvar4P+Fu3srKynsBBsKbGQpasjXwIQG/pnDb6OlWEHzjp0l1wnmvqE/co0q8LoKme0i IwhMjfABi7LHbjqcWx9cTs67UjlqohFa7yEklgl8yJm8QIcwewIgSqVPXkaSPeqmbAEt 16X5LBeT5sW6TLDLhvV+M5WOAQ5BAV5lDwDbsvzh3V7bFBPfPxckwYt5AUfbMaxr/TDt R56A== X-Gm-Message-State: APzg51BXvz2XCqIGy6Y+J1dD7UUMAJvbvyutfboAs0NHML2AOXlR6ZoL l7AhpC7h/MS62MztR9BPqzkpFZAoaY/kVQ== X-Received: by 2002:a19:aa52:: with SMTP id t79-v6mr4773619lfe.85.1535555280238; Wed, 29 Aug 2018 08:08:00 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id l1-v6sm729870lji.41.2018.08.29.08.07.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Aug 2018 08:07:59 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Sascha Hauer , Janusz Uzycki Subject: [PATCH] gpio: mxs: Get rid of external API call Date: Wed, 29 Aug 2018 17:05:56 +0200 Message-Id: <20180829150556.11106-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The MXS driver was calling back into the GPIO API from its irqchip. This is not very elegant, as we are a driver, let's just shortcut back into the gpio_chip .get() function instead. This is a tricky case since the .get() callback is not in this file, instead assigned by bgpio_init(). Calling the function direcly in the gpio_chip is however the lesser evil. Cc: Sascha Hauer Cc: Janusz Uzycki Signed-off-by: Linus Walleij --- drivers/gpio/gpio-mxs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c index df30490da820..ea874fd033a5 100644 --- a/drivers/gpio/gpio-mxs.c +++ b/drivers/gpio/gpio-mxs.c @@ -18,8 +18,6 @@ #include #include #include -/* FIXME: for gpio_get_value(), replace this by direct register read */ -#include #include #define MXS_SET 0x4 @@ -86,7 +84,7 @@ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type) port->both_edges &= ~pin_mask; switch (type) { case IRQ_TYPE_EDGE_BOTH: - val = gpio_get_value(port->gc.base + d->hwirq); + val = port->gc.get(&port->gc, d->hwirq); if (val) edge = GPIO_INT_FALL_EDGE; else