Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11377568ybi; Thu, 25 Jul 2019 15:20:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqztB9YreLsGl9a5tNJxAzWlBnsJnmWxda5EOSpg7rYgJ7HAmoiRkEYJFtP19H0L8VNY0v75 X-Received: by 2002:a63:7245:: with SMTP id c5mr74579661pgn.11.1564093204114; Thu, 25 Jul 2019 15:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564093204; cv=none; d=google.com; s=arc-20160816; b=g9IThGjZp8+E/pAcbelX3fLhth8i2r//EIAgsTd9W+U9YYEIxfhmV8axz7BNBnqJbo tVIgdd0+QMV0pBb59nHHbOQ2vxdK1O+a4Mi71WeocKyRldF3R8mxRS7mSxotaYFzrHR6 CCpXH6xjJS4xWmwY3ul7mG1W4xJd24jY33s12Kd+4PfUBY+llP0zbxJEOTke2s0r+aY3 RtECXfu0YPQXwpR/Ytf3ZHcio2ullVGUmeCfzqyjyR1hiHLxHkQfRCxmmcmZdsWLT8P0 DKB9kupfDc/1XeTI5wpNuYyCcPpmZi6t88JkDFR7xoGvV4YTTRIMocJtyUXZ+ouQ+8cN H2SA== 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=xgmSGdIDu0v4P5hRNEQENmsRjAPMzQvZ2XtfdY307wY=; b=VQ6IYC+g9B1WQ07TqzokGCtRFIIiHUIqMgo4zGNlEFTvVBxl2VTIPUAEjm7NAsg5Sa Hmfj2joSwuAsEJThEtJuLsDeAFE+tZsAdzs8Wz7j4hNEGjAmhR0oAVCKAg7rREauP1Sy e/N52jru5yVKi87x/ZpQsyfFKvzPA1ilsvkLbMHf8AYBbE6dtWCYtmottVAFcrUWV9Nv ETJg8+31SW0t8rVgJAUDKs3YulUb89JsjP1+9LEnwotpb/Pz7b64uXsSvU1pdvK6ih9y 3SFnY1kR3JG37rytpQsQMkqX75V4e8JhbaF5DYEyDvgMybEJCb1Cw/0w6wm3mHaTfRw/ +epA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bjUFoDkw; 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 t11si14366776pgu.16.2019.07.25.15.19.49; Thu, 25 Jul 2019 15:20:04 -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=bjUFoDkw; 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 S1726920AbfGYWTI (ORCPT + 99 others); Thu, 25 Jul 2019 18:19:08 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34496 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbfGYWTG (ORCPT ); Thu, 25 Jul 2019 18:19:06 -0400 Received: by mail-pf1-f193.google.com with SMTP id b13so23436832pfo.1 for ; Thu, 25 Jul 2019 15:19:06 -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=xgmSGdIDu0v4P5hRNEQENmsRjAPMzQvZ2XtfdY307wY=; b=bjUFoDkwwtUAE9rjXGY/yoZmv4SUpw3zs28N86CLMnkSz3U+2bn3+TLJS+4walCtmB PVQpuIprCpvqgGD1hWDh4l6z7HtvdCGuNaShzu+KiztS8VV1ubwC6cMtXT9B8gqsYZpA sP3T9ywIr4mAS+PZ98Ckn5ZGC1sZ/ATKTqJeDkZ6+0YlEmEEbN14p+4uUcVmseHdfP5s DHmjxk72WKm+GFVr/biN9GvWyyvLqP7zztIloxDv1rrIieRYpNA9mjJheq0ihmCV9jNW CXiQyERh4pgRHH5XRbCVnmwwLYv4sqP3LBIHGx5fH3LcaAWNjeAgBfH788SsDqKtqjyb eLyg== 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=xgmSGdIDu0v4P5hRNEQENmsRjAPMzQvZ2XtfdY307wY=; b=cK78RPsQHf12oHsWed3yKWwAoGkyTM2g5SD+gRrT+Pe1BGXykRaUGseImtMvFxvikA T2K5PsMNJR1dO3fnk8sBU3zkL8XbZKMJyyp91YTeWbQVblGWVmnCcbzfohaaf6Q7gicQ kfxfVzAX+r1XGGDXdchW+k9+zGA3ZCQ5KU9BQFOBsKvotpLbqltD6v4nyCVet5gUblyf cISbTQ2/nx19BbSdeHOEFXCestlP/MXMrjQK/4rKaFYwswkGUHsWgLUzhg0hdaRsrd1f c+LritK+/RaQjmEN6zRO/3O2gp0mkf2lsuy0Ce1PlOWdYOYffu44tWIm9clCK0XcpnaN ZE2Q== X-Gm-Message-State: APjAAAWsci//Jp0cE6cOsunrPIA/Y9hTrKBDLoLXfOYDwykbQnyZ/Qkb rYwpSWctDOBrGbZoC9D5C3Tu7Lkca3LsiQ== X-Received: by 2002:a62:16:: with SMTP id 22mr19525541pfa.151.1564093145400; Thu, 25 Jul 2019 15:19:05 -0700 (PDT) Received: from localhost ([49.248.170.216]) by smtp.gmail.com with ESMTPSA id 21sm46989303pjh.25.2019.07.25.15.19.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jul 2019 15:19:04 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, Andy Gross , 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: Fri, 26 Jul 2019 03:48:37 +0530 Message-Id: <355cd15c91e02716140d7114fd403559487b66b6.1564091601.git.amit.kucheria@linaro.org> 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 --- 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 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) -- 2.17.1