From patchwork Mon Oct 21 10:35:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 177043 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3223799ill; Mon, 21 Oct 2019 03:35:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZlV3nBCdHndGTFfsb7qv1a5xCWCgGUJ+MA316xDngmTZRr8CNfo6PozyKE2g9L96QfEbM X-Received: by 2002:a05:6402:2c5:: with SMTP id b5mr1221037edx.157.1571654151685; Mon, 21 Oct 2019 03:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571654151; cv=none; d=google.com; s=arc-20160816; b=x6JAz0TLsx2LQHNfq4a9TuGksc1A4teyANqpB6lIDquU5nOVMI3ma7jT4YqenJf0DF TmYeWXVQQAPYAtvFzDsVYAC1naVx7ZkcMLg4RH4U55BTwsWmSk0w1P5xN0EUrDyYNorH h/3bfw5NhWNlwLSEvsfGMLqmUf2pNwb8fXDfQnDxQz31YJsSmf7FjeUz8mmxjAtQD6ln lY1YSo9YzZANgymLAI23TS+DLcVrJ2ByyzYRwvaZ2rdUESuhBqpyOtLR8E6YKQy09++J NfJDDArt1rBUFi4+t2mde7cupzFu6v4B7xFJvTbD3ELlsWBSXvtGGHJ6xRezlMVJZBk3 m/KQ== 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=IM45/wO/35cCaoykYzpqdd61j7MyYyvfpbeIkVImc8uMGwtkk+uI89Fvp3hZNpEef5 LvBPRJPnzPUn7bdus1ux4LmR5GDIEYC8q14gelP4xOsuTTgRRcqbObheDL8E+fsJZTrF /x0xH7+dDKYZDE6oowGrRAjmVL8T/ELgbbExUAF1LN2AFEyiwi4Hr00nyyV5KiET3D45 +4HnRS4WUPl9FH1DC33twyj70xVOaStMeL7lnVapVSyD87H0hjIXZ8GWCXfQnddMnaQa dMLTonDGypnlQjwbAZqgYH+KUkbr+ig3M9SPo0J9cTsw4oFMSUBkB5ZI4nozZEhah7Xr SpEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F20sjx0y; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 b44si9634713ede.451.2019.10.21.03.35.51; Mon, 21 Oct 2019 03:35:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=F20sjx0y; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1728227AbfJUKfu (ORCPT + 10 others); Mon, 21 Oct 2019 06:35:50 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44371 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728197AbfJUKfu (ORCPT ); Mon, 21 Oct 2019 06:35:50 -0400 Received: by mail-pf1-f195.google.com with SMTP id q21so8154206pfn.11 for ; Mon, 21 Oct 2019 03:35:49 -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=F20sjx0yS3J6Y1j5JsXZ2Gpm20YNzlBp1Q9Sh/pFUqGmdiaOG2MjLbZMFn+mL+S7py 7Djb+E855QkNZOggjigBXw87iY0cOhXI27sUJwGAlVjCuJi1TaE+qHGoc98Ek08e3cpu 4vMffBQ+hcVwtddGYa1fPuYCu5mq2MYAL0l/iCEvWK+KdjIORO4pLVmaUmJjBpl8cJp3 VaDydgsopnGKZJzZ82yjCH4xJNyw//AaQLkLHFubBpHqrwF0IouKcslwojVBzUtI2uaQ 6r2SqNedzxv7HvJVJ0W+2OjkO81BdXDQfyVuPQoYVOccXuAZLQUY1J6qJhPiQWHpzpj0 +dmg== 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=CFnTtq7ttzQ0MOAW1FcNR5FbTd6m1gb30/2MVY2P87Wu/Q3r6NJZGId2yQbrhcSEKR TS1vv/QgjilkFWmmuu6jgaVBkJnUOWtFe5dOzdbtEQkGfIqAoVyILjsi40m6K6QJTw/q erdOeR8gnALeDoOMC621qQw7lSnp14KUMVZKRnD3HNolvWO1F95nKki2sKZDmnwKFve5 LJ53gi3mCdu2z1V/BP4xasjC4TirXkC+QRqRvaxXr317meilZIq2bN/kVpLZSCyVf7es zrXwY5cDHtFYJ24EWw2cHwWILeix88l2bVrqYc6aUrUP2uRpHqaUPlNGc7nFFhWvZWXX OOUA== X-Gm-Message-State: APjAAAWZS+R9VmmhwlFaiEnxst8Y8KkvR9a/wN64KXknwERXE5uNqCEO uKKeybMHSNMpxg/TDQxEyjds1w== X-Received: by 2002:a17:90a:b304:: with SMTP id d4mr28610421pjr.27.1571654149379; Mon, 21 Oct 2019 03:35:49 -0700 (PDT) Received: from localhost ([49.248.62.222]) by smtp.gmail.com with ESMTPSA id k6sm20516678pfg.162.2019.10.21.03.35.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Oct 2019 03:35:48 -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, julia.lawall@lip6.fr, Amit Kucheria , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v6 02/15] drivers: thermal: tsens: Simplify code flow in tsens_probe Date: Mon, 21 Oct 2019 16:05:21 +0530 Message-Id: <184422dcc1c12553e71a58c62e01425fd7d1172a.1571652874.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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)