From patchwork Wed Oct 16 07:34:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 176427 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp6992641ill; Wed, 16 Oct 2019 00:34:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMhllFNk3XVsv5O0Hjna9MYoisa8mSaEBEOSMd+dZtEEj0Ff9CH589KhYDkW8xn9zu1m2O X-Received: by 2002:a17:906:1d02:: with SMTP id n2mr37985341ejh.303.1571211277064; Wed, 16 Oct 2019 00:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571211277; cv=none; d=google.com; s=arc-20160816; b=TEkWi0vZG4awGOx5WKGHcfa6LbUtPh6jySgLHUtvdHaQwkXBmU+/qmPSr8irEgZyvS 6U0PWM5muFNH0AH/KhbvdDnVFZspPf3f58HXZn7L9GyymkBV9qMJaE8nnajp2DQ+XKhy eNzUia76DZsBMBeS4ywzKrrNxcqQoD53goeUzq/tXkvpft0XoTretXMFrKOgvc+gzVJH LOpMfJd52g4/SYxZcRa2ZMkjsk6R1Ry1m0/RFUWD/4yPAcieyB1DL8J8/91l4/SHle9/ 3D6zA/fbeEIZHcwqyBZRxcA2iT14SozpULKaQXwOT4U9DC3fwtgEXNep/aPr/dEt80cz ldMw== 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=JaGoowrMcZ7vZDnJsoBjpYURT7ml55lj/Axup1bZFILRjstjWKIzOaqcBN7kPh5fUg UfoLGigW1RaXBjK8Ca5Lsie8zF05OObmcSoGvtcMU4qlNS680el5m+wNcgT7fBNc6PPi d3kKkJomTJmfFbAHSP43oaijkPfG0ZRkqCk2749nltpzuIVCgwkNfujZGBXI2vtC7NK/ xE/B0zfiwKm3N3XLMswx79U2woWOE7y4Q3UEAZk7LyWaEh6oJLgzWo7EYHPWuSRi3nVS vkxZyVxPFgVaCD7skPIvDHZeLK16argZXaem5Djr9IO0oBfXVf5i1xtr1XXye4qPuhXC yEXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zr8Jj6FL; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 b25si15461161ejb.49.2019.10.16.00.34.36; Wed, 16 Oct 2019 00:34:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=zr8Jj6FL; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1732347AbfJPHeb (ORCPT + 10 others); Wed, 16 Oct 2019 03:34:31 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34158 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732309AbfJPHeb (ORCPT ); Wed, 16 Oct 2019 03:34:31 -0400 Received: by mail-pf1-f195.google.com with SMTP id b128so14177122pfa.1 for ; Wed, 16 Oct 2019 00:34:30 -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=zr8Jj6FLnbAxHmN67Iiq1ZcLMchv+Ks/Xp8pWezcbvbe+OApPGXcik/g3TNk3LpCdn WqiMviPLfH4XpdhwwAjIO0HcaT+jzOcX1q19E/1nhHn4RLP03eszEg5BwAv95ODScHzl JZmDR3UbqSJzvqzT8KUI1AEZZgg+FUOEvnXpRfbq1Z+6/U7JBZLYCt1cwitQd0wmLkEA AKngyASWhgcLKrJNFfYpZfi9yZSyBTJX6NCr2Xyk6ck1mmcSjHH1UqHvZ3Cubx0wclSo /yJy0+zURpm9IagVQz5jHEmUPlKj0gbgX2093XrBsL3LVGxRTuvRHwsgexb+USPuV9WW fdwg== 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=UoYIqY/6kT84SwpGaregCN/TpEqGjJb6Vd2tKh+f/wVnYJHUT9Pq4twY/vtwxdglpi 2TBzRb58i9AlDhBfIfxBqKYnZbtqjkqTZM9VxTDn5nC1U0E6dgL9VRwflgdfyaJG6kcU mInppNFMgtVS+frzW3Q1dJo+649Kny8RNoyh6mO7MjDOKsjOKxv14ueTAjXtiswewIfm 2KZqAKaCIrD2lojmKOMZl1fDhlxy7lx6UKlKwPliGeOtv07VKhEq8P6ZFtTG2Yqsb7DE Z91ZSOL6C6+czEQpKpm4rkVcXhlblCYS/wgtUB2GscHYvmBSLU3nq/cGfZVaPRoYIVLG AMkA== X-Gm-Message-State: APjAAAUmBZwVwMoyrB5wzT3dk1bG6AyBbZmkoXYHpl4Y5914BkUwsgt6 HuvVstktBXcSWaJnEZn7Ti72iQ== X-Received: by 2002:a63:1423:: with SMTP id u35mr5608555pgl.122.1571211270181; Wed, 16 Oct 2019 00:34:30 -0700 (PDT) Received: from localhost ([49.248.175.127]) by smtp.gmail.com with ESMTPSA id h186sm31611631pfb.63.2019.10.16.00.34.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Oct 2019 00:34:29 -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, Amit Kucheria , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Wed, 16 Oct 2019 13:04:01 +0530 Message-Id: <184422dcc1c12553e71a58c62e01425fd7d1172a.1571210269.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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)