From patchwork Thu Oct 31 18:37:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 178219 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3242354ill; Thu, 31 Oct 2019 11:38:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwawq166U/wDqgmPEgLYZCNslOSVNBObmH9UIrTS662nJ6GmMFpcxfKc8qwztWeG9kvXoGt X-Received: by 2002:a50:d717:: with SMTP id t23mr7745878edi.231.1572547081994; Thu, 31 Oct 2019 11:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572547081; cv=none; d=google.com; s=arc-20160816; b=m7k5XsDf//dm02K9kySCbX6rSadgigKEJvOUkLoRah7HYOY7M6SuxzHQhszaskCrSb 5/7sWU4TT9nFiJoEwJMozeFAA91IrMsQ7wbZJr73j8gTB72PAU/hvsLKsUvt1KxYgZa9 VwDC15xNS08f5rMrLv1ALwUfwEQ/vqnv87ymyOVJOLCaJODqV422A70eGjXyZ2Hq4ekT mDnTJIY4W5VbMjxZqu4OuBQ6gxQOnPYvYHGNMXsKcjEGsNWn4ptE4BrBtu9IjNG3HuPJ 0JMYshM6nBpcanOONp5vpNySu0kOdofTf3Gfzh/SvyIDI/1RrKn2fT3KrQb5bbx7mfMc tsng== 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=BcKGfqptsJMIyqg8m+kdv7mwKKvvYfua8/fbCWYYrS8=; b=ws0AL3ISvkRVqxDeMhm1fumBfiAro/yWhaSQbjBwQtvS79xBO62frVzsymyFpglGqc fWzKWnjHRkNEyl0SkD8ydiA5L0wKpTdU97tOEBRbo9nTTJmCwEmFXZaU27Zp9t5b1+BM bq65jW2vMf8k6/2V2NDemTjFxuspT8q/zNlsFGilfauQtKgxBkhoU8sGzCIveW0JqHj7 mlDMP+RwyH97/sFCmxGx0PRAQP9btl9nR6H+UAVOml1P9ek1euIM1BfI3vpDIxWzgZtT 1gQnJjXfCVnghGVSrzxkdd3YRTcxNHow9hLiV+1tVnCqCrVo7lIPLGH3dcd0eLyLVaqd WnQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yzuWC7Dd; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 m1si4008702ejx.188.2019.10.31.11.38.01; Thu, 31 Oct 2019 11:38:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=yzuWC7Dd; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1729405AbfJaSiA (ORCPT + 15 others); Thu, 31 Oct 2019 14:38:00 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46760 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729374AbfJaSh7 (ORCPT ); Thu, 31 Oct 2019 14:37:59 -0400 Received: by mail-pl1-f196.google.com with SMTP id q21so3057299plr.13 for ; Thu, 31 Oct 2019 11:37:59 -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 :in-reply-to:references; bh=BcKGfqptsJMIyqg8m+kdv7mwKKvvYfua8/fbCWYYrS8=; b=yzuWC7DdKOymjQAIXS3fQpz/AFUyegTPXZiWYggYg5P3og3YOrYbQcc13K4j9/F7uQ 7hopJ+Gyy5MsAFQeGMVaFz7WSVTAQWBLfJ+T5TkFLTjurRkCAD9SXbgiqgP0S66K9OSG cJ9rjMQuiz3+5TzGmdw5xgOc82lXWYwfB4fBTmcvi+OUHRau8VHiADvu80vBzGzPh/Lm u3nrGZIBtRPgS+mVNXOXZSx5mfyPbr0maiB80XTi0eFoEsp3VKW0Cws1uCudUxG3rKqs 2BhXDJDV6z4X8NCLPnRP2yNCia8eNBrW5quyHRQMXq0XWFm76OhsTd3iCAHvWpN6DQWm ubbg== 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=BcKGfqptsJMIyqg8m+kdv7mwKKvvYfua8/fbCWYYrS8=; b=SiXMChXYPxeiGnF8Yr6mffckep9yDOMH3a4WkEJFgYrS8yUEwSZWbANYFSKDiYtG0T jm0fSySXdk57eTsorYJqQWvoH0BB+NAW3wQ6edzdVlhAy5cYI90DwpKAIlML9ZfH6OJf +g4MBd+X3RqY0HGOQQbrWmCeiME9B9A9dmSyrr6yN/mqFC1dvrf3xA+cRMDzf8aluIt6 NyS92Um92kJqPXte3lRgV3Y144zZMl0CuU+J91gxabRH7mMyXEmmMMLRxuFEpBmWvAj1 1YKXAMLRRKKCaFM39VY6tdM8SSwJWedZ64jZCmMzTsmMMHuCASKf60I+iHLadkk4nRDF iUbg== X-Gm-Message-State: APjAAAXuTVhLoRv41163gZiRazzVGIMjwZ3tsX1iXAew7vOmactuSYZk im/yo4P1WsTIBNavHBqNoIJYAw== X-Received: by 2002:a17:902:b7cb:: with SMTP id v11mr116253plz.176.1572547078664; Thu, 31 Oct 2019 11:37:58 -0700 (PDT) Received: from localhost ([49.248.58.234]) by smtp.gmail.com with ESMTPSA id t15sm4237531pfh.31.2019.10.31.11.37.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2019 11:37:58 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, agross@kernel.org, masneyb@onstation.org, swboyd@chromium.org, julia.lawall@lip6.fr, Amit Kucheria , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v7 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Fri, 1 Nov 2019 00:07:26 +0530 Message-Id: <184422dcc1c12553e71a58c62e01425fd7d1172a.1572526427.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move platform_set_drvdata up to avoid an extra 'if (ret)' check after the call to tsens_register. Signed-off-by: Amit Kucheria Reviewed-by: Stephen Boyd Reviewed-by: Daniel Lezcano --- drivers/thermal/qcom/tsens.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 6ed687a6e53c..542a7f8c3d96 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -149,6 +149,8 @@ static int tsens_probe(struct platform_device *pdev) priv->feat = data->feat; priv->fields = data->fields; + platform_set_drvdata(pdev, priv); + if (!priv->ops || !priv->ops->init || !priv->ops->get_temp) return -EINVAL; @@ -167,11 +169,7 @@ static int tsens_probe(struct platform_device *pdev) } } - ret = tsens_register(priv); - - platform_set_drvdata(pdev, priv); - - return ret; + return tsens_register(priv); } static int tsens_remove(struct platform_device *pdev)