Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1969496ima; Thu, 25 Oct 2018 07:44:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5eIISjC37RhakgayvB4O9gc6CLZqUknLolrce3lsLsTqDR9K/c8SupIhHN1z8pf6zWfymNI X-Received: by 2002:a17:902:e081:: with SMTP id cb1-v6mr1797272plb.206.1540478647328; Thu, 25 Oct 2018 07:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478647; cv=none; d=google.com; s=arc-20160816; b=KNWKIXdK6D6wDZrCfFcvzo/VXgEOtlcYRoTNlStmV4ovbus+NECTab1tchncacvjPl iLY/doouRJB6PPLYX7zyx6QjTUDgVA9P+KhT0YirCyStcGCfp1fg2+htxxjEbcOSSQRI nJWwjovkWPH57out9ekV1b09kGji+5aHyPrELh84myv1yyf8vQv8fYORQS3lg2mm5eR9 uBvaYnPOboiM+PSxf0Dox+dEap7hdw0FIapINrcpT7LzrjT5fPNtOSewbrQwUvdcJa3E 0EQaJ3bcJySch6fZVeVWuOYW0abCaVOHQ/oFcq31qYP5k2o/0Un5KFwEeacqmmWD/ois j7sA== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=vrCq5T7OlUJcsiA0EtAqCXGDBlq43/eWUdxRjZS+Qfk=; b=BrMlG/O5PpLzJLbJ+OnvJ7LJ7zlSi/xxVSMg/fkOk1ShVUnpGLg8kFB0+4yqEoJ+WS 6h7vEs5nULm2Bz8HFoTmlqcXk1TOx9BtJnipCZTMcLCNlaOSIiD5CAzMlGuov+8vRLP5 FbSeyE6DF8HBiC9kWeSevXAQ+LTN8Zyx3qoo5cuQCfa1Bou6rL83L/brA0ELULtlDFuz S/BVeOxcA85qj5kF5l2Ct6aT0ibc5j4oDU57w3pbYR2/UiRfuz3flGEEVfX2Ruy7KI/p qqrEK+/aA6AJBv29UFNcN9PlMHe7UkwxNBX+2Rq7ak+D+IIghgu0NBNorlijRnxBAUIB hGGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mA8ApO7g; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17-v6si8143916pgi.491.2018.10.25.07.43.49; Thu, 25 Oct 2018 07:44:07 -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=@kernel.org header.s=default header.b=mA8ApO7g; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728797AbeJYWsD (ORCPT + 99 others); Thu, 25 Oct 2018 18:48:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728494AbeJYWsC (ORCPT ); Thu, 25 Oct 2018 18:48:02 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D631420834; Thu, 25 Oct 2018 14:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476905; bh=juvJHMYGCf+DRwLatpEas47J3TbuSjhLEDzXc1dFIJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mA8ApO7g0nbckId1/559PbSfawrmBYuy23C5QNo/K270C+4haQwBrZxk74wYQXxTs RKTZTvQVRF4CBEQQr86IVockfX0T65+/VxlbtDaK96P53Uz79fEIF2FiNE/ru/FPSl XlDjGy+K8s1OjsPGkXfXlKlaQmflJmCUFc469n4o= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arvind Yadav , Tejun Heo , Sasha Levin Subject: [PATCH AUTOSEL 4.9 27/98] ata: sata_rcar: Handle return value of clk_prepare_enable Date: Thu, 25 Oct 2018 10:13:12 -0400 Message-Id: <20181025141423.213774-27-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arvind Yadav [ Upstream commit 5dc63fdcc09f47fb226b8bc7d83a61feb787d817 ] Here, Clock enable can failed. So adding an error check for clk_prepare_enable. tj: minor style updates Signed-off-by: Arvind Yadav Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin --- drivers/ata/sata_rcar.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c index f72d601e300a..e83a3d3421b9 100644 --- a/drivers/ata/sata_rcar.c +++ b/drivers/ata/sata_rcar.c @@ -890,7 +890,10 @@ static int sata_rcar_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to get access to sata clock\n"); return PTR_ERR(priv->clk); } - clk_prepare_enable(priv->clk); + + ret = clk_prepare_enable(priv->clk); + if (ret) + return ret; host = ata_host_alloc(&pdev->dev, 1); if (!host) { @@ -970,8 +973,11 @@ static int sata_rcar_resume(struct device *dev) struct ata_host *host = dev_get_drvdata(dev); struct sata_rcar_priv *priv = host->private_data; void __iomem *base = priv->base; + int ret; - clk_prepare_enable(priv->clk); + ret = clk_prepare_enable(priv->clk); + if (ret) + return ret; /* ack and mask */ iowrite32(0, base + SATAINTSTAT_REG); @@ -988,8 +994,11 @@ static int sata_rcar_restore(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); struct sata_rcar_priv *priv = host->private_data; + int ret; - clk_prepare_enable(priv->clk); + ret = clk_prepare_enable(priv->clk); + if (ret) + return ret; sata_rcar_setup_port(host); -- 2.17.1