From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932523AbcBVOca (ORCPT ); Mon, 22 Feb 2016 09:32:30 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:14126 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932297AbcBVOZN (ORCPT ); Mon, 22 Feb 2016 09:25:13 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Mon, 22 Feb 2016 06:24:11 -0800 From: Laxman Dewangan To: , , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 38/61] gpio: sch: Use devm_gpiochip_add_data() for gpio registration Date: Mon, 22 Feb 2016 19:38:27 +0530 Message-ID: <1456150130-2668-39-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 need of driver callback .remove. Signed-off-by: Laxman Dewangan --- drivers/gpio/gpio-sch.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c index 5314ee4..e85e753 100644 --- a/drivers/gpio/gpio-sch.c +++ b/drivers/gpio/gpio-sch.c @@ -215,15 +215,7 @@ static int sch_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sch); - return gpiochip_add_data(&sch->chip, sch); -} - -static int sch_gpio_remove(struct platform_device *pdev) -{ - struct sch_gpio *sch = platform_get_drvdata(pdev); - - gpiochip_remove(&sch->chip); - return 0; + return devm_gpiochip_add_data(&pdev->dev, &sch->chip, sch); } static struct platform_driver sch_gpio_driver = { @@ -231,7 +223,6 @@ static struct platform_driver sch_gpio_driver = { .name = "sch_gpio", }, .probe = sch_gpio_probe, - .remove = sch_gpio_remove, }; module_platform_driver(sch_gpio_driver); -- 2.1.4