Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5467237ybl; Tue, 27 Aug 2019 05:15:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXo9pK2Py/6MPQcqeLOVScqQ9Sg5TB+TdESZSuScp43TicLpwbDRWuIfZ66It6jmo0OI/J X-Received: by 2002:a63:1045:: with SMTP id 5mr20805058pgq.165.1566908152013; Tue, 27 Aug 2019 05:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566908152; cv=none; d=google.com; s=arc-20160816; b=CKXwE22nGP9+iZ+TDZz1I50kfeJSaNRBt/zQZ+iw9R2Oq8uLwPsFsSa1LMgejcH+Ll aCd+B3FSaTU6j3x1h82KZ/zJmU9OE+MqWrg9sNmkiXiiXXi58kuVprfaJzoR7q3zLM7Z f/VIePD/n41vh6pdMOhXSkDH2PclbWGb8rLPY7jKQyqYz6Gr59CvkQ6fCysSdGhka3do x6QxZeR2sMNAJwdpjFXCO8/5+dyzxbvpI8bH6bFMfgRFIpPb8Js6/zdFJBmT355YYV0u 4461TmwGtIb6cfGRHxO4TDKIhUJe3ioZdm4XgQwakYDsLXtnj7R3xkRFkeKISYG7FDOD IgmA== 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=ByQuSAprS9jXkayR9k8WNXgC0XRVOmuonTQ+tfTnFgQ=; b=Hwi8+Lui8i79cOoj2T+xTxVjRjS+CZBv1WWAIEcNhRl7PjW2/8nKdqVplPiLMWqHZ6 6u19l7Qh2pdCKdNoU4hErmcb6xAqfjne/gwHP/kQI0VcNMp7LZRxaXTIw+o4A/wt260k Nnbjiz1WIVEqj6xAYacRzOP8WlSjNqNeodvETvFL4nAls2ojuG0UzU92LGzgcVfF6p5d dJSSe3GqoCl0HUBZK7+uLKg5FUgfKsuqw4YD3lG8YSY6V4oInp4yJKBsY4o7zqgLij7E Ej/+HmUrQf/Ff706pW3OWDQr7Atc4hJk8pVTr7baYh+w8oJ8r82nCF5MUVW4YsSksEFV Yd+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oFeXeHu8; 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 200si13848527pfu.152.2019.08.27.05.15.30; Tue, 27 Aug 2019 05:15:51 -0700 (PDT) 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=oFeXeHu8; 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 S1729650AbfH0MOd (ORCPT + 99 others); Tue, 27 Aug 2019 08:14:33 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:47081 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729552AbfH0MOc (ORCPT ); Tue, 27 Aug 2019 08:14:32 -0400 Received: by mail-pf1-f194.google.com with SMTP id q139so13988519pfc.13 for ; Tue, 27 Aug 2019 05:14:32 -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=ByQuSAprS9jXkayR9k8WNXgC0XRVOmuonTQ+tfTnFgQ=; b=oFeXeHu81LKsmIt7qd79KgGaAgbRDvhtHEbzcJsDTIyDIb1vjLZzGCUYrlXBrhVh0H EHqo53y0jOX76nzMTDHT60A74TY5VPOzJaptg87naVQX71fv2xpUsxrdf4JTzLrG3P9y UL+fVDfDy5e0LgG3YOKlutwrj2KKTkzGaKwTcvEXR39Hw++yOHdyn+wW/CiylqacqCS6 GlSyL25Rws+1zruhvD5N06QYOcT3XfLU/SmgccDhL185GVlWBljOK/DMxbk9IAphVKYL 27bUZP8p16RYF5L+sU1wsRzIpSnaCjctervDPIayul04UHC9uV6HMHbAhT5l+AaamjTu da/g== 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=ByQuSAprS9jXkayR9k8WNXgC0XRVOmuonTQ+tfTnFgQ=; b=ugZ+kEYgyuoB0IfTWmUxaC7fb2YFgmVgveQ9gP01a3A3Aw/Stzc8BNd12uUpZT2sY8 OrW6qadiTNguMrJnc71d28P3kWxNgPlfFZ2MJLSlnBGLbGbp8V49eHeuBNTGyQOAvN+e 0kW96WvCLT6d60/CwUSRurjSsbXb5PRpqCPnBm4MZeaa7drcRGUcPGlYn8w7gMKPfRpU 9a+BDJ9aH+9tQoKIYPHXaA+9ZlpaGN0YrPqgGAH08Q3QBtzVD7IBlwxM9FIdv6GBXf+m pUyAnUQVOUQJZ/pAa0syjrMsF9+/ZrRwr793n/GB0e4fzF/pFejXGuadQmOVaqQJsfqJ vxEQ== X-Gm-Message-State: APjAAAW4qs9QNtcnZ5VJOFt9MyUVpzjp5JzUig4liSr7VhujiAHDtqgx 9U08M5eSmNJgUsO3oMj3zdXjA0N28NpKuQ== X-Received: by 2002:a63:3c5:: with SMTP id 188mr20528160pgd.394.1566908071328; Tue, 27 Aug 2019 05:14:31 -0700 (PDT) Received: from localhost ([49.248.54.193]) by smtp.gmail.com with ESMTPSA id e13sm18207682pfl.130.2019.08.27.05.14.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Aug 2019 05:14:30 -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, sboyd@kernel.org, masneyb@onstation.org, marc.w.gonzalez@free.fr, Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v2 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Tue, 27 Aug 2019 17:43:58 +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 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(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 6ed687a6e53cd..542a7f8c3d962 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) -- 2.17.1