From patchwork Fri Sep 20 21:52:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 174158 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3031664ill; Fri, 20 Sep 2019 14:52:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGJX3QbV2FwP3i1ZpkTs28voZjvku1oanyn6dzpjSFtcfmZJadmqcRiCGy8pGC/rTIA64u X-Received: by 2002:a50:f391:: with SMTP id g17mr21819589edm.163.1569016370883; Fri, 20 Sep 2019 14:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569016370; cv=none; d=google.com; s=arc-20160816; b=Nz6IyzqeNSwS4ut/j5faSJhsBrmldtZ3yfyo8cIVbJf6w3TlvQRnhbMiBwPwLKJxOF VwSNGRPdyGvw/BID+3QacSP5t3OLnt2mtQELCnbpclhdjRFYgZgFIgu4TgTnu5S/P28Z etPSwI12oKK0d93up13oRjYINtEskOO98IZT6+78suzNj9CfEX3Z/anZJI2pEkl6z/pE IAaXTYpmYVnK5KV5bq5YxSKOy+tpuIfteBy5Veq8klYYAbgA2NaJ+h90q2dXSRUM5PCJ 5+l0iCsDooV6TavVq2JM9Wl2HyJvQueEmuEsZ+JZdITIfTBm/6dFVkMsqIevwx6ulxu5 zgrw== 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=aghbtv5QW4VwgEMuylnwSBsbpD1kHVIAVqJdyMgYJV5uw0qkIZLd17/vL8Nx1K2MoR YQEcOCjJE5emIHfD+ErKuul4tHxzW1viwU4CaaemYTp4OLUFRWSlpAbc3SXp6Qx7IplE CIT93I297x2ZVw6PxyGg97XhOE4XuGRHacLajve+5w5kqDFCN4i7RXtIBwG+ukEX01Lo m1vD32cmQBTmoIBurGex7iA9fEp1PPHy4dsnO7E2jn5IR18XQxOsBQ5x1VBhukulcEKB ZZMICffQznbYYpsg6I5e0AkwFEkVHZS2zuxroAzrpygwWqxdvoYqmLdQCz5//1zPvGcx jpkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gC01BHP1; 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 d17si2225527eda.213.2019.09.20.14.52.50; Fri, 20 Sep 2019 14:52:50 -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=gC01BHP1; 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 S1727600AbfITVwt (ORCPT + 26 others); Fri, 20 Sep 2019 17:52:49 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36357 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727275AbfITVwq (ORCPT ); Fri, 20 Sep 2019 17:52:46 -0400 Received: by mail-pl1-f195.google.com with SMTP id f19so3805146plr.3 for ; Fri, 20 Sep 2019 14:52:45 -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=gC01BHP1P590aH1DpG92/2a9eu0OC50zfmGm/ISqUL+Edf8eKtzKtYupItgKC3NC4V YnGr79289Q1KN/q09yX1oZGTwgPpeMNTg9Ms/0sHXfbVLv+eRLYFb0iS5h2kMPx2Pt/H nm3cx01VKVxgVY7U6ZdSgX73IFqs2evm5lYv/fFrllMl3gQ4UBsg77QnTCUAkR1sLsfv OHXm5zlBci/Ps2gD1m7LsdNXuUKp9Um7cQeKq6bNJV3q2wNiCpKa2nBUTmnazNXOrJGL 24l+eQUYSg4WyryPMS4GYEZtqovCvhGgbQKyYxqim1UAVkBeE/IRUSQB1o5u83ISfFJj yZyg== 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=bT87W7jvW8pD7wCVr8J/YyDdPLxufY9Fk5gckJgiWBbT5oorv79mdLEAXzh6NrFUU3 rC9leLZniYbW8+iE7ryW9ggPLOv0kvD9V+pB5/owkf+dzbYtSI7hKSzLalS/LpwNUprj OHdkhvW0zIWCmfARbR499nKgLwFo9+Xvc97yvuIgk9BkhnObPNIY9+f1RcLp0lWivDY9 o3VqJoPlSmNZSxcWp+24GsInnhY4yqSbrF0xI/IHm+5+2+qiQccH3DZ/aNWdh/5FNz79 ciNtVTODTS309zOZIZPeazX4JgnWx1CiCWYWCR3YAXUVjAD8jXy0ZkBmTKuFu4paqdxc FWZw== X-Gm-Message-State: APjAAAVRwyQZ8lIVjNKcgLTAsBfOpct4/6YZS/aVt3aqbdJSQqhQYL7L +d4g4lq2k24K6KdvxS3L4VIcrnqPu5zPVg== X-Received: by 2002:a17:902:8bca:: with SMTP id r10mr4121889plo.43.1569016364897; Fri, 20 Sep 2019 14:52:44 -0700 (PDT) Received: from localhost (wsip-98-175-107-49.sd.sd.cox.net. [98.175.107.49]) by smtp.gmail.com with ESMTPSA id 22sm3480863pfo.131.2019.09.20.14.52.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Sep 2019 14:52:44 -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 v4 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Fri, 20 Sep 2019 14:52:17 -0700 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(-) -- 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)