From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbcBVOVw (ORCPT ); Mon, 22 Feb 2016 09:21:52 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:14783 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753819AbcBVOVs (ORCPT ); Mon, 22 Feb 2016 09:21:48 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 22 Feb 2016 06:21:43 -0800 From: Laxman Dewangan To: , , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 04/61] gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration Date: Mon, 22 Feb 2016 19:37:53 +0530 Message-ID: <1456150130-2668-5-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456150130-2668-1-git-send-email-ldewangan@nvidia.com> References: <1456150130-2668-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_gpiochip_add_data() for GPIO registration and remove the call for gpiochip_remove() from error path. Also remove the need of driver callback .remove. Signed-off-by: Laxman Dewangan Cc: Alexander Shiyan --- drivers/gpio/gpio-74xx-mmio.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c index 372b0e0..0475e8e 100644 --- a/drivers/gpio/gpio-74xx-mmio.c +++ b/drivers/gpio/gpio-74xx-mmio.c @@ -140,15 +140,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - return gpiochip_add_data(&priv->gc, priv); -} - -static int mmio_74xx_gpio_remove(struct platform_device *pdev) -{ - struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev); - - gpiochip_remove(&priv->gc); - return 0; + return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv); } static struct platform_driver mmio_74xx_gpio_driver = { @@ -157,7 +149,6 @@ static struct platform_driver mmio_74xx_gpio_driver = { .of_match_table = mmio_74xx_gpio_ids, }, .probe = mmio_74xx_gpio_probe, - .remove = mmio_74xx_gpio_remove, }; module_platform_driver(mmio_74xx_gpio_driver); -- 2.1.4