From patchwork Mon May 29 15:46:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 100667 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp395166qge; Mon, 29 May 2017 08:47:01 -0700 (PDT) X-Received: by 10.98.113.72 with SMTP id m69mr18698557pfc.195.1496072821252; Mon, 29 May 2017 08:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496072821; cv=none; d=google.com; s=arc-20160816; b=qBTuHsinreYsxikJ8jTGX+loxCxXmN9GiGIyYnEWPC1OqgsjxAiSP4fB1Uq0tpTiWt ix143BQIexCGgcmlFJGB4JfOkTwfGjQ2rjC4gI5mHzvbwvFRKeEBCKb2BZ6EqUPoWGH0 qxewr701cQzRT3yFUaVWIJGGF95BAvk3Rbi9feG4AuHXRGKxIT6JPQO0A4sCKwQ93ypz t3s4ZpPq7/3WegBgttRNr8G7MQoEcq+9c2dPFScpwSftnMRf0zGNm39SnVqJY+xEtP/1 G6FVQNdz/NZo0ucK4fEYu6u+UYdJTF5/Fy/biZnM7AwBe5TYwCGxLByxoMW4fxdGmrml vALA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=D1v0xT4Arloy/+74iwVUGMwRLi5gKXPq0wCut4i6YFo=; b=NUPRbIJpnsOIVeEtMDIXkIIWdt9rv5mXAOFEwg+/v9eIMmo0Ux6dgcsIW371Y5japC V8EeEQFzTgMfB6TZ1U4oqEsi2th4c8CaE7mHJULVXVvD5MIkw2seU1z+LZcytwCHoFFp WoYLwhsjIvN0/CtZyBVH0peaN9iyxPf6QeEBbiNVERXRyesjUH5Fp+kB8MWNplvTqcTY t285Y1F8QKOmAG1miYD121y0wKO4M1S1gXbEfILV7ibxKDrHItSF8SJ/M5gy5FRB71rf 18X6yI8/UYWa0BKbCyC1nFAu7AqyKgjiujpqudfSIII1vyxuUgmBiJhPBmuofQPn/Ibu g3yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 190si9455906pgi.411.2017.05.29.08.47.00; Mon, 29 May 2017 08:47:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdE2Pqp (ORCPT + 25 others); Mon, 29 May 2017 11:46:45 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38650 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbdE2Pqm (ORCPT ); Mon, 29 May 2017 11:46:42 -0400 Received: by mail-wm0-f50.google.com with SMTP id e127so65985051wmg.1 for ; Mon, 29 May 2017 08:46:41 -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:in-reply-to:references; bh=D1v0xT4Arloy/+74iwVUGMwRLi5gKXPq0wCut4i6YFo=; b=Sk+HFH9uB/OcqjpycWGiHk1cps6HW0XwGL38JgmDzUaI8ox5/h3xhXEdY/A4UikiaX 6nrYqNZXjSxpYHKRVtMrBiz/+ohMdtLY63Y2gTBVHU2hlw5BBWhDP/2LQz3Hz1RHS0vL EdJKGtpvZjkKun97odXbM7KM2qSHZt6gVQtfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D1v0xT4Arloy/+74iwVUGMwRLi5gKXPq0wCut4i6YFo=; b=htR9e22Nav1zCDLYjmjHl+7zpYQjfimeqI4eRlgMUg5br/abaScy+HPdaLpXKNDZRj R86jjFPfZWlMvZ4ZiQ1vYTqYQz1l6jT4HTxc4BRMd9MDVkCOgcn4XOc9jB+fkToK8Z/q enOQtyDjJdlrhSyjWd8IYS2Ok5T3FVIbe2tZ1u8uwFoHmKRLyAyQtrIM0A8sWuIFDseN 3i4A1ZlaIOxsAFCyyGDmAXaFwc3kkJmWWLTyWtRcCu1Ab5gNbsx1FaK0X0RIlHAE/MP8 MR1/Bx6HewMQ9QXbjXbueSM0dFJyHlUBIyZbIMbWy/pdIf4t1NHmA8QVdOsHOFoY2vsd jQWg== X-Gm-Message-State: AODbwcDgChlpGGBpHVaENYVtlrCs7JaBT/coJ2y17SIhUg1hZ7RuTork B5u1cvl2uUxqzz3+Ep16SG/W X-Received: by 10.28.173.85 with SMTP id w82mr20912373wme.98.1496072800908; Mon, 29 May 2017 08:46:40 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.227.188]) by smtp.gmail.com with ESMTPSA id 79sm13210721wmo.13.2017.05.29.08.46.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 08:46:40 -0700 (PDT) From: Benjamin Gaignard Cc: Benjamin Gaignard , Lee Jones , linux-kernel@vger.kernel.org Subject: [PATCH 12/15] mfd: qcom-spmi-pmic: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:46:00 +0200 Message-Id: <1496072763-31209-13-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496072763-31209-1-git-send-email-benjamin.gaignard@linaro.org> References: <1496072763-31209-1-git-send-email-benjamin.gaignard@linaro.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Usage of devm_of_platform_populate() simplify driver code by allowing to delete pmic_spmi_remove(). Signed-off-by: Benjamin Gaignard CC: Lee Jones CC: linux-kernel@vger.kernel.org --- drivers/mfd/qcom-spmi-pmic.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c index 8653e8b..2022bdf 100644 --- a/drivers/mfd/qcom-spmi-pmic.c +++ b/drivers/mfd/qcom-spmi-pmic.c @@ -120,7 +120,6 @@ static void pmic_spmi_show_revid(struct regmap *map, struct device *dev) static int pmic_spmi_probe(struct spmi_device *sdev) { - struct device_node *root = sdev->dev.of_node; struct regmap *regmap; regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config); @@ -131,19 +130,13 @@ static int pmic_spmi_probe(struct spmi_device *sdev) if (sdev->usid % 2 == 0) pmic_spmi_show_revid(regmap, &sdev->dev); - return of_platform_populate(root, NULL, NULL, &sdev->dev); -} - -static void pmic_spmi_remove(struct spmi_device *sdev) -{ - of_platform_depopulate(&sdev->dev); + return devm_of_platform_populate(&sdev->dev); } MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); static struct spmi_driver pmic_spmi_driver = { .probe = pmic_spmi_probe, - .remove = pmic_spmi_remove, .driver = { .name = "pmic-spmi", .of_match_table = pmic_spmi_id_table,