Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030937AbcCQOFj (ORCPT ); Thu, 17 Mar 2016 10:05:39 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:33068 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936172AbcCQOFe (ORCPT ); Thu, 17 Mar 2016 10:05:34 -0400 X-Originating-IP: 88.159.34.112 From: Maarten ter Huurne To: Mark Brown Cc: Zubair Lutfullah Kakakhel , linux-kernel@vger.kernel.org, Maarten ter Huurne Subject: [PATCH v2 1/4] regulator: act8865: Remove redundant dev lookups Date: Thu, 17 Mar 2016 15:05:05 +0100 Message-Id: <1458223508-20740-1-git-send-email-maarten@treewalker.org> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1265 Lines: 33 The local variable "dev" already contains a pointer to the device, so there is no need to take the address of "client->dev" again. Signed-off-by: Maarten ter Huurne --- drivers/regulator/act8865-regulator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index 000d566..89f856f 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c @@ -498,8 +498,7 @@ static int act8865_pmic_probe(struct i2c_client *client, act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config); if (IS_ERR(act8865->regmap)) { ret = PTR_ERR(act8865->regmap); - dev_err(&client->dev, "Failed to allocate register map: %d\n", - ret); + dev_err(dev, "Failed to allocate register map: %d\n", ret); return ret; } @@ -526,7 +525,7 @@ static int act8865_pmic_probe(struct i2c_client *client, config.driver_data = act8865; config.regmap = act8865->regmap; - rdev = devm_regulator_register(&client->dev, desc, &config); + rdev = devm_regulator_register(dev, desc, &config); if (IS_ERR(rdev)) { dev_err(dev, "failed to register %s\n", desc->name); return PTR_ERR(rdev); -- 2.6.2