From patchwork Mon Aug 8 08:03:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9266903 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 B89AC607D6 for ; Mon, 8 Aug 2016 08:03:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2B8127B2F for ; Mon, 8 Aug 2016 08:03:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 971EA27F86; Mon, 8 Aug 2016 08:03:25 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23C1D27B2F for ; Mon, 8 Aug 2016 08:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbcHHIDY (ORCPT ); Mon, 8 Aug 2016 04:03:24 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38273 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbcHHIDX (ORCPT ); Mon, 8 Aug 2016 04:03:23 -0400 Received: by mail-wm0-f52.google.com with SMTP id o80so120848518wme.1 for ; Mon, 08 Aug 2016 01:03:22 -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=iI6rk6QGM23l0GW0quCu5GXB8891v6VHm21xF9ZceZA=; b=kRN4C9gVGK6BmS9C0Qh6WH8v7SOOrM8yCi3wW7msdP6o7NNyATvkQMWwUzRP4xXwsh rfQY17EBYskdkulLY+Ak9aDQgNHqQln/CvaKhltrO6oRgF17GGSGpOd9WaFfu+Z350W/ hgA3GljeUlD+eEFiAvGqdmyL9G6VLMK54MgEM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iI6rk6QGM23l0GW0quCu5GXB8891v6VHm21xF9ZceZA=; b=B2JDbbLbNP2sQ7ksith3zjXdoIHSVt4hqHSBbT9LYE0zmA8AFDFvtC61jmOam0xUGV 1dn+Knr2ANJl4jBny3supF+pf5xIeJ3ear8jEylAGp1LLYEqpwJoYnE6dUnxjw9wFKMl Gcd9cCiwyHVrbtOdv/kUXySxHFs4vw+ilmkMcO+5AWz5NjRnOKySh5ROxmvjwcxbi0pG Z/T0lXMK/7uv77M5I3rgtbPCdH55tXrHgZ3VdRNqsSuC3GsvBuTvhPUqtt0YcGsapWoN MAeK2sfrXLyH+NKCWwgMyr5hpZ6t3HN28Lb1AD1eaTIjH0BvRoxmjklw80dm9pCQS7d4 cj2g== X-Gm-Message-State: AEkoouvRNIJE9MCgkbi7X9D51eL2IoW0f3GvA2ftGkB98J4KYXykSd827dMZu8PBh396yfDx X-Received: by 10.25.131.141 with SMTP id f135mr22915552lfd.217.1470643401558; Mon, 08 Aug 2016 01:03:21 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e65sm5415644lji.32.2016.08.08.01.03.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 01:03:20 -0700 (PDT) From: Linus Walleij To: Roger Quadros , Tony Lindgren Cc: linux-omap@vger.kernel.org, Linus Walleij Subject: [PATCH] memory: omap-gpmc: use devm_gpiochip_add_data() Date: Mon, 8 Aug 2016 10:03:16 +0200 Message-Id: <1470643396-6795-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This saves a few codelines in the driver. Cc: Roger Quadros Cc: Tony Lindgren Signed-off-by: Linus Walleij --- drivers/memory/omap-gpmc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 869c83fb3c5d..b2aea23ca0ae 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2266,7 +2266,7 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc) gpmc->gpio_chip.get = gpmc_gpio_get; gpmc->gpio_chip.base = -1; - ret = gpiochip_add(&gpmc->gpio_chip); + ret = devm_gpiochip_add_data(gpmv->dev, &gpmc->gpio_chip, NULL); if (ret < 0) { dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret); return ret; @@ -2275,11 +2275,6 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc) return 0; } -static void gpmc_gpio_exit(struct gpmc_device *gpmc) -{ - gpiochip_remove(&gpmc->gpio_chip); -} - static int gpmc_probe(struct platform_device *pdev) { int rc; @@ -2394,7 +2389,6 @@ static int gpmc_remove(struct platform_device *pdev) struct gpmc_device *gpmc = platform_get_drvdata(pdev); gpmc_free_irq(gpmc); - gpmc_gpio_exit(gpmc); gpmc_mem_exit(); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev);