From patchwork Tue Aug 27 12:13:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 172275 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5701805ily; Tue, 27 Aug 2019 05:14:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkM/XnZhMRMSsM/KW12T1mZ2d9PUS+yJlLbDTnUTluSUVteuVC09GR02KDCvrQLdiESaMa X-Received: by 2002:a63:69c1:: with SMTP id e184mr20089863pgc.198.1566908073791; Tue, 27 Aug 2019 05:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566908073; cv=none; d=google.com; s=arc-20160816; b=NHBTzetUHKHVUpWV69MS8URCre9PBvN8rRpvvE3zyteJC4uLbwoi/tFNjfCfzHeytF opLHjQ8r7x4WhLOrV4ccTkBeQe3ipv8QadMl/J9B9+go5ptehxW8eudS3T1cggvBnoSE E+ZvSRbj8UOz6wCgAZmwwFQ11WIg7MvJKTdRhY/yyU4A8OSEHpN4sWIiGb12+0/b/p5T NtAikL1WT8VB5Myh+TmWBtP1FrMLNFtHMihhSOheWLlwVPFahlT1JzLDVhy/eArEQM+1 UK17f6xxRsq1wB3Ej+00dSaSADfuqrwFMtjkTMmTu/RvgHJAGFraZH8K0QlGz64/Hf35 htsQ== 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=DAXq02QnmGT+xLnFwQ5mPtjAF5vCsK0f1o1EZjzXRCnPiKkZ71bzeohrYBtrmOahpn Le7r7jIJh0yjs7FyqM6un4qy65bIyITbMnJSZezTw+QgnPzEVTZXTtoQWgwy38TIDTK+ XlZOmHpPOVzIlBZO0AT33yPWsji/CUuYGHKj6jkYMHZo1TaFOqLJ/A08YYpzUbGQtqWW /vm7zAbtz0MwXmL1ZEvkakXzszhKVzLzDKBWH/wevKGcWSppJfCL1QzvXdS0BtPrGAvO ZbMSVRV6jLiTLTNQEzHWCRG+qeD6BHt8aqkrc/O0I/hdMjwaT+Bog7qbl9sRo7fe2+hZ tWFw== 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-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 w6si11980757pge.395.2019.08.27.05.14.33; Tue, 27 Aug 2019 05:14:33 -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=oFeXeHu8; 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 S1729619AbfH0MOc (ORCPT + 16 others); Tue, 27 Aug 2019 08:14:32 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33975 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbfH0MOc (ORCPT ); Tue, 27 Aug 2019 08:14:32 -0400 Received: by mail-pf1-f193.google.com with SMTP id b24so14043112pfp.1 for ; Tue, 27 Aug 2019 05:14:31 -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=ngLG9y70ZidE7j+AhOLvuwbHiZ+SrRoPhggQpDPS91T/HJ3jF/IW+eKLtR4+bbie4Z YW+R0hwQGgk3GRFh3phB1i44l6cFzsLWIOyUJ4TsMFLHnrMYCzQ+3xZEDafII22D9KVQ 3Vmzji/YSA0bKSYUNiW7CMdl0vbaKw8I+XkT52LHdJkR7IkJPvSH2bYcZNZeTqe7kOxF liCR7MlSvcpOmGi+azFfg5sx88WC7x0PiiDtCTUvq2qu13ZdOHjCt40T1aCgKyfQZ/ql 50Bve2q1YXRAZ3kHtvdngJwxFaAQRlxXTg5WQLQrd0fCUJLnLeML2TO9oDiwqsyjp0h6 R0vQ== X-Gm-Message-State: APjAAAUXrEdiANLnfivlq9L02FLNb2qCAE4atEpqKkVphrVFUfybT/+t VBKVoMGWfS4inIzqBf0JPGO1bg== 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-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 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)