From patchwork Mon Mar 4 16:52:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devendra Naga X-Patchwork-Id: 2213411 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7201A3FCF2 for ; Mon, 4 Mar 2013 16:53:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756841Ab3CDQw7 (ORCPT ); Mon, 4 Mar 2013 11:52:59 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:33957 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756359Ab3CDQw7 (ORCPT ); Mon, 4 Mar 2013 11:52:59 -0500 Received: by mail-pb0-f50.google.com with SMTP id up1so3184442pbc.9 for ; Mon, 04 Mar 2013 08:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=j+Pek7SOxXEWyuxMPVDpx8LeCt2n5jq4ifmZqME13RY=; b=lfXFnWcpY4m5fvb3EJIgQDeTdDo/fKghzo8OpfT565wuNq/xUwibTVoUhBYdmJvjqZ 3D0XI21Iwx3ONE/hfiyfAYwqk1PFaJ5IMD1ZaHGsz9bHhco4fKdAuWq7EWGHcDG4g2z8 zKMxDrny17+1o9gwXkXpelg3edYQyR6jn3EuwkXdnrUd4hoqrCIOFOvhmIhVZ/kEviou LWDnEe98QjUaWg6pFZyjQmmn8fIPbTLW9ESI6HSBEuNYt/fb4FWfbA6gaUWwttAfNDay I3+m/57Bx+FvBnRFFzU2XvqQZMHsSe2RYpNI9sa85tFYAEawbTNbTzdeNFt/hBxYZoHq 9jtQ== X-Received: by 10.68.213.132 with SMTP id ns4mr30068177pbc.84.1362415978636; Mon, 04 Mar 2013 08:52:58 -0800 (PST) Received: from localhost.localdomain ([122.172.43.199]) by mx.google.com with ESMTPS id gf6sm22890729pbc.24.2013.03.04.08.52.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 08:52:57 -0800 (PST) From: Devendra Naga To: Zhang Rui , linux-pm@vger.kernel.org Cc: Devendra Naga Subject: [PATCH 1/2] thermal: rcar_thermal: propagate return value of thermal_zone_device_register Date: Mon, 4 Mar 2013 11:52:47 -0500 Message-Id: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org thermal_zone_device_register returns a value contained in the pointer itself use PTR_ERR to obtain the address and return it at the end. Signed-off-by: Devendra Naga --- drivers/thermal/rcar_thermal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 28f0919..f1726c9 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -363,6 +363,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) struct resource *res, *irq; int mres = 0; int i; + int ret = -ENODEV; int idle = IDLE_INTERVAL; common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); @@ -441,6 +442,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) idle); if (IS_ERR(priv->zone)) { dev_err(dev, "can't register thermal zone\n"); + ret = PTR_ERR(priv->zone); goto error_unregister; } @@ -460,7 +462,7 @@ error_unregister: rcar_thermal_for_each_priv(priv, common) thermal_zone_device_unregister(priv->zone); - return -ENODEV; + return ret; } static int rcar_thermal_remove(struct platform_device *pdev)