From patchwork Wed Sep 11 07:16:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 173590 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp374131ilq; Wed, 11 Sep 2019 00:16:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSLjIETLC0UAMhdGU/iIBMqkovV52xG/JgcLYvVkF3exA4BGvGdXluXGc0/in+VX7JAvPs X-Received: by 2002:a17:906:3293:: with SMTP id 19mr28305203ejw.265.1568186210006; Wed, 11 Sep 2019 00:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568186210; cv=none; d=google.com; s=arc-20160816; b=rTMhn+V9yZjW6M4YywwvGvsM2DteAPx8uo0+W8l+XmGf5hy4wdCxTygDZN8heaoiPL y1VcnPhxcsbwyOhuqGxaF9q71jsGjdhrJYm1yDxEBNFleaXcnCuV8KRnSr3m5o/aIeob +VEo8wWJXv0P+9RqnqAwkCWEiZolUTTFjrZhHcaqyvtN1EFXOKgjJTu5t3IlZ3oFPtqL ZR7kLpIiX4vvgwhJ/mUD43qLi2XH2lIt7SYgh5VSPg2pngQpFyW+/DsEIKjSglaODYAQ iS0q07QW53OnojVqpBR4P2PPdhvPxpVSjZlEvJdcaDx8aOw40kLpJfmxpMnoZuNmiQDS W82Q== 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=cocgesLcn0+MOi3wKIiGz/34F4wXpWpYWgLi9NV7N9Sw8ttwiqv0SVpe9Lq9rwLklC x2wp4etciDY14KAFEO/PfX0mrqx9oWKyRdGimvBlL/2nnQomN4I5juTzJUmdZYAcRFwV FQS+288JD5dUVbMd63RtMUJY4wPMIsE0A/Fxhu16rSXh3e/Io5KmWhmQxn1ZwG1QMO2c qAVKP7Kczbt2IT2favSSgj/gT+oiQa5C3E5F7KN1hxEu8LuEf8th2fcaBzothOll4odY bcmthSgIvEhnyvyvuHf73aQ5ONa7Q4q8Kb9nU8n6ONQYFw7AthqyNu+cdcl0BgtEJ9Hs i9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o7pSB/lB"; 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 u2si2623689edp.191.2019.09.11.00.16.49; Wed, 11 Sep 2019 00:16:49 -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="o7pSB/lB"; 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 S1726988AbfIKHQt (ORCPT + 15 others); Wed, 11 Sep 2019 03:16:49 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44826 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726838AbfIKHQs (ORCPT ); Wed, 11 Sep 2019 03:16:48 -0400 Received: by mail-pg1-f195.google.com with SMTP id i18so11038989pgl.11 for ; Wed, 11 Sep 2019 00:16:48 -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=o7pSB/lBJepCsIAK9wwEl+41gBqxhzj1JE5Xk93Xw+PiLLGCJiaRXIgX89oRURyZnw l3RtJSgM55DVzGJjWn4+MDNVoP63T55tIwc6Q5UURuq4/Y3FFS5V23mHe1sVX1K7hWed oQ2vD5nDD4cKYHQMqs1ShVZ7s1ZcieLRdx12COreB9e9vazjIAfQH0qkMOxgbAvMis7H /3XEpCvRHuhZx7j6J3FmzwjCMwDqLMzZd/sIa4LxZhl+TIQWHZbDva4KqVoad2s5xT7S x0eDDX5jO85RYBiiXqBTADEBhZwbO15EZfMLKNsiNqF+bExaugY7uXjyl2+5UEzDL894 EKzw== 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=TXg0U8v03XE8QmoCLBKWdvxZjUmSEoABJ4QSv8Eh+7nmMPMl+h3nwBd1cary/I4uvf WKw4Vw1bfCkP7E7lthz/DiSQ6n5t/Hjxs7HL0QxEMTd8nuS46dvi/YBLpiDWDvZDPf0s LP/58QADXMtj1nERhjCGwd85EHS1oV7GXsONHOATt+Im7nYCcHbDk9NQI5dsc+aKD+b0 sWrkeOLM2UP1KFecpiOLFUhtGvpHosKkjSLv2r3KAPj9uXAcqgCSUygm9vwFSRCfokvA EO7HXqGc6HVkvhQGkCteq8UMmKv5CoP19ufQ2pojUMJnxUDFSPdbHWKq22RwaohAm5de P7bA== X-Gm-Message-State: APjAAAXHwoes879nRDM8ZUwVAkp7aeyGLISrucaZ0TddR0AnRhDzD1aE M9xSXWR40ujzJzTNhbCRWob5pQ== X-Received: by 2002:a62:e508:: with SMTP id n8mr20353567pff.199.1568186207721; Wed, 11 Sep 2019 00:16:47 -0700 (PDT) Received: from localhost ([49.248.201.118]) by smtp.gmail.com with ESMTPSA id 20sm24094678pfh.72.2019.09.11.00.16.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2019 00:16:47 -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, Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v3 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Wed, 11 Sep 2019 12:46:19 +0530 Message-Id: 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)