Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6736136yba; Wed, 1 May 2019 19:23:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP/+wIuPdX5NgEhO7Qk7sKq57xu+HtMXS+AB5vdAlWEzCpyXFwkMI4MZbvwZ2GcsT00hOr X-Received: by 2002:a17:902:9a46:: with SMTP id x6mr928604plv.71.1556763839440; Wed, 01 May 2019 19:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556763839; cv=none; d=google.com; s=arc-20160816; b=uE67XhqZMAkF/gf9+ECAk+3OBlKZJ0ck9Aw7cxs2y+4NZdLmiGVzjmBjcQkYxWRKMd vrKda9GHWcPPIx+y9o3Hl6R3uD32chj95G3a2oObtiNFLfb0u4kgkw/w9gM/QRiwqvw8 /Kjx3JZxW9W7dSGdLjSP00Q9dAQHMhxr4DpuZfgiO+mUfeynlkvkIuAx2uhRqJgzsytt FNmQgsdUztPmMBbeJP+ON9ip0ZpDt/FcpiutsQGFook4b5jQM2ZnWmy9UgrTXyUJfYSH luTJTalrMNDq/4AxQql03zcx+6W3qjOvm11yDDKiQcG9dFlKvChuAb+TvnC6cQMTtEt+ izdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=oA8tzqPqM1UUXhOEIjynTm5arH7kOmcJGLh2VgChYiI=; b=wm9UgHiZnuiPy5ZA+dNreLLKAWyKKlTQtY1N2ohJ4dnWb+w+ZdiCLSpwhMXojG1VYI RFOQpD2R4o9PTviqfM6GGYxHPRjZo4BEZYFne8fCNpoAXlLq1AbF7+xidyoi9T/bJFsn CDG+wAJlSDHRPD2e4GbVI+lULuxNhaQh905snhqkGGEa8QR2mi8WuWDO7wBzL+0FfsGu EFel2DiPALiNtLCAiqwCEBAabcuZ8oVa1CqltjRnyhQUEDHQzlghUNR/WYcFcePb/3jO ETJh3XbkY5hgROFs0hITKitggV7RW3VKf9RsARdexCtQQfAuVJc2Rj3/EmM/vS3Jbv0P 9MMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=qDPxsBUr; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36si2838577pld.439.2019.05.01.19.23.44; Wed, 01 May 2019 19:23:59 -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=@sirena.org.uk header.s=20170815-heliosphere header.b=qDPxsBUr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbfEBCTB (ORCPT + 99 others); Wed, 1 May 2019 22:19:01 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:56386 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726519AbfEBCTA (ORCPT ); Wed, 1 May 2019 22:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=oA8tzqPqM1UUXhOEIjynTm5arH7kOmcJGLh2VgChYiI=; b=qDPxsBUrGKyQ S+xY+JYIvUXlyRzFFltRYzOxfKVVSx9k5JCpkcZvqQ6PYBZTTAaG9JtzoGVkMg/EVPotwOCZiLJI/ IgTZXizDzKoXkFpZ1KzjX9UjmqLoEL8PrcXG0u7ivCBTK4SMlSeQDadiUCkCaMxMd0Jus+0wdDund f+XXM=; Received: from [211.55.52.15] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hM1JI-0005uO-0m; Thu, 02 May 2019 02:18:56 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 1E126441D3E; Thu, 2 May 2019 03:18:53 +0100 (BST) From: Mark Brown To: Axel Lin Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Mark Brown , Pawel Moll , Sudeep Holla Subject: Applied "regulator: vexpress: Get rid of struct vexpress_regulator" to the regulator tree In-Reply-To: <20190429113542.476-1-axel.lin@ingics.com> X-Patchwork-Hint: ignore Message-Id: <20190502021853.1E126441D3E@finisterre.ee.mobilebroadband> Date: Thu, 2 May 2019 03:18:53 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: vexpress: Get rid of struct vexpress_regulator has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.2 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From eeb1b2355a6f06c4995ce282e247afffb946d983 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 29 Apr 2019 19:35:41 +0800 Subject: [PATCH] regulator: vexpress: Get rid of struct vexpress_regulator The *regdev and *regmap can be replaced by local variables in probe(). Only desc of struct vexpress_regulator is really need, so just use struct regulator_desc directly and remove struct vexpress_regulator. Signed-off-by: Axel Lin Reviewed-by: Sudeep Holla Signed-off-by: Mark Brown --- drivers/regulator/vexpress-regulator.c | 53 +++++++++++--------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/drivers/regulator/vexpress-regulator.c b/drivers/regulator/vexpress-regulator.c index ca4230fe9e77..a15a1319436a 100644 --- a/drivers/regulator/vexpress-regulator.c +++ b/drivers/regulator/vexpress-regulator.c @@ -23,17 +23,10 @@ #include #include -struct vexpress_regulator { - struct regulator_desc desc; - struct regulator_dev *regdev; - struct regmap *regmap; -}; - static int vexpress_regulator_get_voltage(struct regulator_dev *regdev) { - struct vexpress_regulator *reg = rdev_get_drvdata(regdev); - u32 uV; - int err = regmap_read(reg->regmap, 0, &uV); + unsigned int uV; + int err = regmap_read(regdev->regmap, 0, &uV); return err ? err : uV; } @@ -41,9 +34,7 @@ static int vexpress_regulator_get_voltage(struct regulator_dev *regdev) static int vexpress_regulator_set_voltage(struct regulator_dev *regdev, int min_uV, int max_uV, unsigned *selector) { - struct vexpress_regulator *reg = rdev_get_drvdata(regdev); - - return regmap_write(reg->regmap, 0, min_uV); + return regmap_write(regdev->regmap, 0, min_uV); } static const struct regulator_ops vexpress_regulator_ops_ro = { @@ -57,44 +48,44 @@ static const struct regulator_ops vexpress_regulator_ops = { static int vexpress_regulator_probe(struct platform_device *pdev) { - struct vexpress_regulator *reg; + struct regulator_desc *desc; struct regulator_init_data *init_data; struct regulator_config config = { }; + struct regulator_dev *rdev; + struct regmap *regmap; - reg = devm_kzalloc(&pdev->dev, sizeof(*reg), GFP_KERNEL); - if (!reg) + desc = devm_kzalloc(&pdev->dev, sizeof(*desc), GFP_KERNEL); + if (!desc) return -ENOMEM; - reg->regmap = devm_regmap_init_vexpress_config(&pdev->dev); - if (IS_ERR(reg->regmap)) - return PTR_ERR(reg->regmap); + regmap = devm_regmap_init_vexpress_config(&pdev->dev); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); - reg->desc.name = dev_name(&pdev->dev); - reg->desc.type = REGULATOR_VOLTAGE; - reg->desc.owner = THIS_MODULE; - reg->desc.continuous_voltage_range = true; + desc->name = dev_name(&pdev->dev); + desc->type = REGULATOR_VOLTAGE; + desc->owner = THIS_MODULE; + desc->continuous_voltage_range = true; init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node, - ®->desc); + desc); if (!init_data) return -EINVAL; init_data->constraints.apply_uV = 0; if (init_data->constraints.min_uV && init_data->constraints.max_uV) - reg->desc.ops = &vexpress_regulator_ops; + desc->ops = &vexpress_regulator_ops; else - reg->desc.ops = &vexpress_regulator_ops_ro; + desc->ops = &vexpress_regulator_ops_ro; + config.regmap = regmap; config.dev = &pdev->dev; config.init_data = init_data; - config.driver_data = reg; config.of_node = pdev->dev.of_node; - reg->regdev = devm_regulator_register(&pdev->dev, ®->desc, &config); - if (IS_ERR(reg->regdev)) - return PTR_ERR(reg->regdev); - - platform_set_drvdata(pdev, reg); + rdev = devm_regulator_register(&pdev->dev, desc, &config); + if (IS_ERR(rdev)) + return PTR_ERR(rdev); return 0; } -- 2.20.1