Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp320543imj; Thu, 7 Feb 2019 05:00:17 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2eE8736gBuiHy9354N1Qv8wIK98LtVj1/JajUpEbbvdqABd7eTUeEOo3jyEk6gUxfRcT8 X-Received: by 2002:a62:de06:: with SMTP id h6mr16407233pfg.158.1549544416953; Thu, 07 Feb 2019 05:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549544416; cv=none; d=google.com; s=arc-20160816; b=s6EGdULbyZcUIf64VVGfe2hfti98jfMbC4ar8VrnhTiVmneXl4bOrZ9MMugeZFI4er lir5+pt7tcT6f3k1TQFgXcJrrIFhwRAvMQuTwpY3lRbB1EIVlbCotYy0VbhKpb9yKhUX zX1C3grHPulXWkQ3yBgTO8ZFKv5vCMRaQBlQa1UAJCEp+yrb4BUHLlEIFoFXFdOrDQ8k VUf8BfROOKPqGmsAb+XL9WQoH03jp5m5Z1acvH/Un46FFCiko+fiG0LyGVYPvmlb1gHb U4oCjnZcBlWCh0MPxkpUFMz+clBNVa+mpI4Hw59eTYmUFy6FyZY1B5jpPc5klxZYgS88 reJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=DhOH74k9WLUHZ9bc4R59OvEiqm0NxoNRQ6D2mdU8GNA=; b=TAttd5DlWscPa8H5XXm/djJygOKDBoeI3VruniX1X5DZ/zvd0+1ANjQcCECt769l5H FoanPzsHdbRHs923o6gcNIHhx0Jcmf0VeNzQI3UcyrdfmImz3PfXYw8LyTRYTCnQymN0 XBSQ9bHEHZ+F/2THYWHhkC75lscIeiALPQVZdbY/v6XS8KL1W6jTW/w7RpjE3LtGXr/W v44LTS4pgkVXzp3QI+ribXrZCUZIJZhruZnBIGjGBX9ZU+JAXE6LG6EvJ3wFTWst5OFD i5arM+XU3g5CBc7Zxs9UveENzzuaDQfOXGu03WckMzyl3NjjLV1esvw1Mr+4np29zKeC 5tcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JgfGa/xD"; 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=pass (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 v8si1687063pgr.138.2019.02.07.05.00.01; Thu, 07 Feb 2019 05:00:16 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="JgfGa/xD"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727628AbfBGM6Q (ORCPT + 99 others); Thu, 7 Feb 2019 07:58:16 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43114 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727621AbfBGM6O (ORCPT ); Thu, 7 Feb 2019 07:58:14 -0500 Received: by mail-pf1-f194.google.com with SMTP id w73so4723567pfk.10 for ; Thu, 07 Feb 2019 04:58:14 -0800 (PST) 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 :in-reply-to:references; bh=DhOH74k9WLUHZ9bc4R59OvEiqm0NxoNRQ6D2mdU8GNA=; b=JgfGa/xDJVcgKShX9fKv+jO2xMqrHtpemIF+1QKP5uUtW9DNeAmGjtKpaXnY8h7Gd2 XyRvEzzkoOir8QfBtzkae+3N99K9yaAiVK0tvCQXWITsyR8D1pEVR0+vkB7tUy5xaE9R Z2064Fx9zf4hSE1lJQfjX3mdjKebq6rMlt+Lw7luRP7ZBCrgaL7OKdnGIMhdu/dqITst mAJT/5mVBQqp/Hz7qiBR8AYD0HWZmcdVa/08A1s4UbhdXmndIpZUYeoUu5a5pUm1014p iS5oY5FiZ2/abEGljYNDhOthiwMkZHucZ9YKsk5xyifCcvV/R46r9N3Q95AMaHlNmQ4n GvIA== 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:in-reply-to:references; bh=DhOH74k9WLUHZ9bc4R59OvEiqm0NxoNRQ6D2mdU8GNA=; b=pql5bO+EURdZdqHavZ0BTmfJbp4FO3VfiV5mAN/vUJGx4VGlnBmjwbQBcU7mOTG4GX Ods7dYGwuxdiK8eRn/hOaPJPPSCXRCc+cJaH/o7oW7P+MRpPq0vwwtQxRX0udP9Ac81v AojDJB1fs7vbUQFfEDXsyvI5Qxh8I0xx+CmWlqhbR3Dd5AQbes5RC/F+UDk2zBvlqyOJ N+OJjgGzEiUtbBsY0N5id281Mq7VK7xfhfcfwScHxaXL4D4npT+j6t7x0rldJtGiy3B3 3crsjZc1HJ2Wh045pD9dqxzY5gf6AYg09uhx63yZP5Rsm8ifJ1Z/pUvje+BQNXuhI5tE tjcQ== X-Gm-Message-State: AHQUAuZ3MWznjT3AmFPPZgkT4n6GGVpYYOirE5v+Y/tnZ7lWv5nTNIGs BP+JDszyvWqdlgM8Oh4Uom/wQU1U/KE= X-Received: by 2002:a63:2ac9:: with SMTP id q192mr14686638pgq.58.1549544293499; Thu, 07 Feb 2019 04:58:13 -0800 (PST) Received: from localhost ([2402:3a80:c80:4138:75dd:3900:1d90:762f]) by smtp.gmail.com with ESMTPSA id i8sm22019348pfj.18.2019.02.07.04.58.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 04:58:13 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, Daniel Lezcano , David Brown , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v1 11/24] drivers: thermal: tsens: Save reference to the device pointer and use it Date: Thu, 7 Feb 2019 16:19:29 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code cleanup making it easier to read Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index a82e4c928a78..aae3d71d7eed 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -119,6 +119,7 @@ static const struct regmap_config tsens_srot_config = { int __init init_common(struct tsens_priv *priv) { void __iomem *tm_base, *srot_base; + struct device *dev = priv->dev; struct resource *res; u32 enabled; int ret, i, j; @@ -135,7 +136,7 @@ int __init init_common(struct tsens_priv *priv) if (IS_ERR(srot_base)) return PTR_ERR(srot_base); - priv->srot_map = devm_regmap_init_mmio(priv->dev, srot_base, + priv->srot_map = devm_regmap_init_mmio(dev, srot_base, &tsens_srot_config); if (IS_ERR(priv->srot_map)) return PTR_ERR(priv->srot_map); @@ -150,11 +151,11 @@ int __init init_common(struct tsens_priv *priv) if (IS_ERR(tm_base)) return PTR_ERR(tm_base); - priv->tm_map = devm_regmap_init_mmio(priv->dev, tm_base, &tsens_config); + priv->tm_map = devm_regmap_init_mmio(dev, tm_base, &tsens_config); if (IS_ERR(priv->tm_map)) return PTR_ERR(priv->tm_map); - priv->rf[TSENS_EN] = devm_regmap_field_alloc(priv->dev, priv->srot_map, + priv->rf[TSENS_EN] = devm_regmap_field_alloc(dev, priv->srot_map, priv->fields[TSENS_EN]); if (IS_ERR(priv->rf[TSENS_EN])) return PTR_ERR(priv->rf[TSENS_EN]); @@ -162,24 +163,24 @@ int __init init_common(struct tsens_priv *priv) if (ret) return ret; if (!enabled) { - dev_err(priv->dev, "tsens device is not enabled\n"); + dev_err(dev, "tsens device is not enabled\n"); return -ENODEV; } - priv->rf[SENSOR_EN] = devm_regmap_field_alloc(priv->dev, priv->srot_map, + priv->rf[SENSOR_EN] = devm_regmap_field_alloc(dev, priv->srot_map, priv->fields[SENSOR_EN]); if (IS_ERR(priv->rf[SENSOR_EN])) return PTR_ERR(priv->rf[SENSOR_EN]); /* now alloc regmap_fields in tm_map */ for (i = 0, j = LAST_TEMP_0; i < priv->num_sensors; i++, j++) { - priv->rf[j] = devm_regmap_field_alloc(priv->dev, priv->tm_map, + priv->rf[j] = devm_regmap_field_alloc(dev, priv->tm_map, priv->fields[j]); if (IS_ERR(priv->rf[j])) return PTR_ERR(priv->rf[j]); } for (i = 0, j = VALID_0; i < priv->num_sensors; i++, j++) { - priv->rf[j] = devm_regmap_field_alloc(priv->dev, priv->tm_map, + priv->rf[j] = devm_regmap_field_alloc(dev, priv->tm_map, priv->fields[j]); if (IS_ERR(priv->rf[j])) return PTR_ERR(priv->rf[j]); -- 2.17.1