From patchwork Wed Feb 3 22:19:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 8209681 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70CD4BEEE5 for ; Wed, 3 Feb 2016 22:27:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C20F320253 for ; Wed, 3 Feb 2016 22:27:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B2D2201E4 for ; Wed, 3 Feb 2016 22:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbcBCW1k (ORCPT ); Wed, 3 Feb 2016 17:27:40 -0500 Received: from smtp11.smtpout.orange.fr ([80.12.242.133]:23175 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbcBCW1k (ORCPT ); Wed, 3 Feb 2016 17:27:40 -0500 X-Greylist: delayed 450 seconds by postgrey-1.27 at vger.kernel.org; Wed, 03 Feb 2016 17:27:39 EST Received: from belgarion.home ([109.214.175.60]) by mwinf5d46 with ME id DyL01s0071JZhHZ03yL1gv; Wed, 03 Feb 2016 23:20:08 +0100 X-ME-Helo: belgarion.home X-ME-Date: Wed, 03 Feb 2016 23:20:08 +0100 X-ME-IP: 109.214.175.60 From: Robert Jarzmik To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik Subject: [PATCH] mmc: pxamci: fix the device-tree probe deferral path Date: Wed, 3 Feb 2016 23:19:52 +0100 Message-Id: <1454537992-15839-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the gpio driver is probed after the mmc one, the read/write gpio and card detection one return -EPROBE_DEFER. Unfortunately, the memory region remains requested, and upon the next probe, the probe will fail anyway with -EBUSY. Fix this by releasing the memory resource upon probe failure. Signed-off-by: Robert Jarzmik --- drivers/mmc/host/pxamci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 28a057fae0a1..405ec339a1b8 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -657,7 +657,7 @@ static int pxamci_probe(struct platform_device *pdev) if (!r || irq < 0) return -ENXIO; - r = request_mem_region(r->start, SZ_4K, DRIVER_NAME); + r = devm_request_mem_region(&pdev->dev, r->start, SZ_4K, DRIVER_NAME); if (!r) return -EBUSY; @@ -840,7 +840,6 @@ out: } if (mmc) mmc_free_host(mmc); - release_resource(r); return ret; }