From patchwork Sat Sep 10 12:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 668370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sWXnK3VPMz9ssP for ; Sat, 10 Sep 2016 22:04:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wCJ+UI8Y; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbcIJMEt (ORCPT ); Sat, 10 Sep 2016 08:04:49 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34766 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbcIJMEs (ORCPT ); Sat, 10 Sep 2016 08:04:48 -0400 Received: by mail-pf0-f195.google.com with SMTP id g202so5381977pfb.1 for ; Sat, 10 Sep 2016 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AgVNKEvh20ztfjSZS0Q76gMSM6ZwIwF7sQ7vQ26JR+k=; b=wCJ+UI8YetFkPReD1WZi69AkqMxzgO2CQXwBjs5f6M+oHlFuondSmaJqm7I8nF1/IF A7vhxRdvOZMA1eawTANTj10lIEhF50uA7eWg/BBsOZA4ng76OqdEOWG6kZnoSUhiIxdc 6x1zbhXzEBR/gTfjhguoNGenBPv9c1jIhGIvZd7WtUpCg5k8WGSJQj6m36Ds7BL11HEQ 4H+yHXyyvF+NFTOoqo4MSsVVbIyLKu7/9ARRtLB+jTz9LGBZMshJ3wwP91pV99HjT3m8 d/FzdkjKVKWYD9A5FGb0GJKdq+KK/draoiK6O41f+3k6hrL63/D4SOtHJSVeBC6wrZNR wiKw== 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:mime-version :content-transfer-encoding; bh=AgVNKEvh20ztfjSZS0Q76gMSM6ZwIwF7sQ7vQ26JR+k=; b=ewh9JKGfAoFW5VW9X/Ru1Eux9V52i1+hCUb137/+k9budzLG9IlVYTkNhy+NLHCjzU Qx6BiDpQtPaChDcOMn0OHoR5JVOhHJS2CNPQJqs3+7d9kfg9pfhg4+h8SqHzxUqicqLK FPuQche+ZdD7+JacMuAXcqaqmeOzZRCj4Lu340WvhzPLqqCKtQ6FC815lzRRKEOkL/ef btPcZBwztHE9HjUpzq+WT3wAxZKqWlihPYxVH4nLFgOEricwB9Bjmg6JMvt8y2VYRn0s qGeMGuuYmENG3Okm3Zf2q+BryBATgteb2evl8YN0WBBgz27C/IOK6LrQC+yPuxCZha3J EFqg== X-Gm-Message-State: AE9vXwNnOZSWSe26NMfWt3UQ8AevIx736BhaTzIOZc96zMcSx5ZFhK2FDVAlNhNMf7UFWw== X-Received: by 10.98.69.202 with SMTP id n71mr15537630pfi.154.1473509088024; Sat, 10 Sep 2016 05:04:48 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id u64sm11941837pfi.0.2016.09.10.05.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Sep 2016 05:04:47 -0700 (PDT) From: Wei Yongjun To: Linus Walleij , Alexandre Courbot , Keerthy Cc: Wei Yongjun , linux-gpio@vger.kernel.org Subject: [PATCH -next] gpio: lp873x: Use devm_gpiochip_add_data() for gpio registration Date: Sat, 10 Sep 2016 12:04:42 +0000 Message-Id: <1473509082-3996-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Wei Yongjun Use devm_gpiochip_add_data() for GPIO registration and remove the need of driver callback .remove. Signed-off-by: Wei Yongjun Reviewed-by: Linus Walleij --- drivers/gpio/gpio-lp873x.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-lp873x.c b/drivers/gpio/gpio-lp873x.c index f10d49d..2386b0f 100644 --- a/drivers/gpio/gpio-lp873x.c +++ b/drivers/gpio/gpio-lp873x.c @@ -154,7 +154,7 @@ static int lp873x_gpio_probe(struct platform_device *pdev) gpio->chip = template_chip; gpio->chip.parent = gpio->lp873->dev; - ret = gpiochip_add_data(&gpio->chip, gpio); + ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); if (ret < 0) { dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); return ret; @@ -163,15 +163,6 @@ static int lp873x_gpio_probe(struct platform_device *pdev) return 0; } -static int lp873x_gpio_remove(struct platform_device *pdev) -{ - struct lp873x_gpio *gpio = platform_get_drvdata(pdev); - - gpiochip_remove(&gpio->chip); - - return 0; -} - static const struct platform_device_id lp873x_gpio_id_table[] = { { "lp873x-gpio", }, { /* sentinel */ } @@ -183,7 +174,6 @@ static struct platform_driver lp873x_gpio_driver = { .name = "lp873x-gpio", }, .probe = lp873x_gpio_probe, - .remove = lp873x_gpio_remove, .id_table = lp873x_gpio_id_table, }; module_platform_driver(lp873x_gpio_driver);