From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755747AbcBVOgR (ORCPT ); Mon, 22 Feb 2016 09:36:17 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13844 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755087AbcBVOXl (ORCPT ); Mon, 22 Feb 2016 09:23:41 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 22 Feb 2016 06:23:38 -0800 From: Laxman Dewangan To: , , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 23/61] gpio: janz-ttl: Use devm_gpiochip_add_data() for gpio registration Date: Mon, 22 Feb 2016 19:38:12 +0530 Message-ID: <1456150130-2668-24-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-janz-ttl.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c index 482aa03..a8d0a6b 100644 --- a/drivers/gpio/gpio-janz-ttl.c +++ b/drivers/gpio/gpio-janz-ttl.c @@ -182,7 +182,7 @@ static int ttl_probe(struct platform_device *pdev) gpio->base = -1; gpio->ngpio = 20; - ret = gpiochip_add_data(gpio, NULL); + ret = devm_gpiochip_add_data(dev, gpio, NULL); if (ret) { dev_err(dev, "unable to add GPIO chip\n"); return ret; @@ -191,21 +191,11 @@ static int ttl_probe(struct platform_device *pdev) return 0; } -static int ttl_remove(struct platform_device *pdev) -{ - struct ttl_module *mod = platform_get_drvdata(pdev); - - gpiochip_remove(&mod->gpio); - - return 0; -} - static struct platform_driver ttl_driver = { .driver = { .name = DRV_NAME, }, .probe = ttl_probe, - .remove = ttl_remove, }; module_platform_driver(ttl_driver); -- 2.1.4