Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp437953yba; Fri, 26 Apr 2019 02:47:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2zikJEpCuL/Lh17w3qOOXySH7sEU3ArSemKy0VfYOoKl9ikjGhtieB8sLylnjF2z6w1kZ X-Received: by 2002:a17:902:f302:: with SMTP id gb2mr16285734plb.162.1556272044370; Fri, 26 Apr 2019 02:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556272044; cv=none; d=google.com; s=arc-20160816; b=kn6MvS7sQ1yUFeA1rxjr6uMwPzbeJkjhEmfurt9oWZ/ifzSHJyNnnyR6YDWLc1eWbg ETph65cT7OSsWk0Izrj9c/m9eGziU2ag83sM9Vu5xfD2P0BcaIaiN0s7JxmjfCN5CXkW 881clmPVr9sIjusv0Jqy9icXUJrx9PlQeovskZJgCP02kvkB3Vk1mX9fqB058Yi9FMbo oCCB/aAnGU9mx4QMEo6Z60cfQP65dUA+qrk9br7RuaOIZusOUQwzseXLNsbmVmi6JvQF ofL+Q/ZBvPaFunRrRFfrc5/3Ocy8TlY4CKcK6JHJSGgOVgpMkbJWW5CtbBYKuPzPcP2I yxvw== 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=RSLf2VHcn1xnUInCdFeL3Ts/cHHcDwd9UlEvJRmoBa0=; b=XgTwbWanLPa0j6fA2fbvVbV/4+rcL+5Vao2dH8j2l/r7yH/SagN2erVYtCQnVyn/Yh Uxomekp/9alzi7QRbW8ja0A8fHdUVlK8AYKUTL4rFIFMHZfGn47qdslAOy6h5yTEdE2Q dbtT2KfwM3BHc0JQBgC9PsqtO/qOW3HuGuKZVPqOCMBCK1DwpzIiR06KJXyDCY+8CReF WCdPdBDdxNm1Nr+Vj+Dq2V4Fxvht665CGrPMkc/+RkBNyiQ4MZQMdjnWg2xXO3vQtr90 17inUuhkslRQDFWkhZv5QP4ftUYMJlUTYnS9FqUjC8/UzcpEvQZf5EYY2j8VNV/DP1tH +wDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="PR/6s+Ty"; 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 w125si26851960pfw.137.2019.04.26.02.47.09; Fri, 26 Apr 2019 02:47:24 -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="PR/6s+Ty"; 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 S1727224AbfDZJoZ (ORCPT + 99 others); Fri, 26 Apr 2019 05:44:25 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:52496 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbfDZJoX (ORCPT ); Fri, 26 Apr 2019 05:44:23 -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=RSLf2VHcn1xnUInCdFeL3Ts/cHHcDwd9UlEvJRmoBa0=; b=PR/6s+TyeHlZ usPwWGlIQL9XP7LkI8MVMBRD0XNJfDqirh+WtLAHF7tNK44+wkVj6aFZZHGzoBRR8a+jhcNvlYR+7 Aw9y5Gt/dHbdO5D4bJHVwSUoFTGBib9xdp8SUK+8IgjpWJwFmFbJpyGS3ERSsuQnDp+24LfgVIOTn j7FOc=; Received: from [37.205.61.202] (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 1hJxP1-0003Na-QW; Fri, 26 Apr 2019 09:44:19 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id BC48B441D3B; Fri, 26 Apr 2019 10:44:18 +0100 (BST) From: Mark Brown To: Axel Lin Cc: Icenowy Zheng , Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown Subject: Applied "regulator: sy8106a: Get rid of struct sy8106a" to the regulator tree In-Reply-To: <20190420030125.6661-1-axel.lin@ingics.com> X-Patchwork-Hint: ignore Message-Id: <20190426094418.BC48B441D3B@finisterre.ee.mobilebroadband> Date: Fri, 26 Apr 2019 10:44:18 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: sy8106a: Get rid of struct sy8106a 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 5d7ebba38bafa8f6eba2540e8a36233ea6d6d0dc Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 20 Apr 2019 11:01:25 +0800 Subject: [PATCH] regulator: sy8106a: Get rid of struct sy8106a All the fields in struct sy8106a are only used in sy8106a_i2c_probe(), so use local variables instead. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/sy8106a-regulator.c | 40 +++++++++------------------ 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/drivers/regulator/sy8106a-regulator.c b/drivers/regulator/sy8106a-regulator.c index 65fbd1f0b612..42e03b2c10a0 100644 --- a/drivers/regulator/sy8106a-regulator.c +++ b/drivers/regulator/sy8106a-regulator.c @@ -22,12 +22,6 @@ */ #define SY8106A_GO_BIT BIT(7) -struct sy8106a { - struct regulator_dev *rdev; - struct regmap *regmap; - u32 fixed_voltage; -}; - static const struct regmap_config sy8106a_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -70,36 +64,32 @@ static const struct regulator_desc sy8106a_reg = { static int sy8106a_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct sy8106a *chip; struct device *dev = &i2c->dev; - struct regulator_dev *rdev = NULL; + struct regulator_dev *rdev; struct regulator_config config = { }; + struct regmap *regmap; unsigned int reg, vsel; + u32 fixed_voltage; int error; - chip = devm_kzalloc(&i2c->dev, sizeof(struct sy8106a), GFP_KERNEL); - if (!chip) - return -ENOMEM; - error = of_property_read_u32(dev->of_node, "silergy,fixed-microvolt", - &chip->fixed_voltage); + &fixed_voltage); if (error) return error; - if (chip->fixed_voltage < SY8106A_MIN_MV * 1000 || - chip->fixed_voltage > SY8106A_MAX_MV * 1000) + if (fixed_voltage < SY8106A_MIN_MV * 1000 || + fixed_voltage > SY8106A_MAX_MV * 1000) return -EINVAL; - chip->regmap = devm_regmap_init_i2c(i2c, &sy8106a_regmap_config); - if (IS_ERR(chip->regmap)) { - error = PTR_ERR(chip->regmap); + regmap = devm_regmap_init_i2c(i2c, &sy8106a_regmap_config); + if (IS_ERR(regmap)) { + error = PTR_ERR(regmap); dev_err(dev, "Failed to allocate register map: %d\n", error); return error; } config.dev = &i2c->dev; - config.regmap = chip->regmap; - config.driver_data = chip; + config.regmap = regmap; config.of_node = dev->of_node; config.init_data = of_get_regulator_init_data(dev, dev->of_node, @@ -109,15 +99,15 @@ static int sy8106a_i2c_probe(struct i2c_client *i2c, return -ENOMEM; /* Ensure GO_BIT is enabled when probing */ - error = regmap_read(chip->regmap, SY8106A_REG_VOUT1_SEL, ®); + error = regmap_read(regmap, SY8106A_REG_VOUT1_SEL, ®); if (error) return error; if (!(reg & SY8106A_GO_BIT)) { - vsel = (chip->fixed_voltage / 1000 - SY8106A_MIN_MV) / + vsel = (fixed_voltage / 1000 - SY8106A_MIN_MV) / SY8106A_STEP_MV; - error = regmap_write(chip->regmap, SY8106A_REG_VOUT1_SEL, + error = regmap_write(regmap, SY8106A_REG_VOUT1_SEL, vsel | SY8106A_GO_BIT); if (error) return error; @@ -131,10 +121,6 @@ static int sy8106a_i2c_probe(struct i2c_client *i2c, return error; } - chip->rdev = rdev; - - i2c_set_clientdata(i2c, chip); - return 0; } -- 2.20.1