From patchwork Thu Jan 23 14:41:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 3529371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65C319F1C3 for ; Thu, 23 Jan 2014 14:45:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 591702015D for ; Thu, 23 Jan 2014 14:45:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F74120122 for ; Thu, 23 Jan 2014 14:45:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W6LX1-0002bH-NA; Thu, 23 Jan 2014 14:45:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W6LWt-0002kk-To; Thu, 23 Jan 2014 14:45:15 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W6LWi-0002ii-N5 for linux-arm-kernel@lists.infradead.org; Thu, 23 Jan 2014 14:45:05 +0000 Received: by mail-wg0-f47.google.com with SMTP id m15so1608278wgh.14 for ; Thu, 23 Jan 2014 06:44:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=VsuLimAb3Er/0swC25Rp7kqtCjZKjL/FNQHCU7hJxpQ=; b=aMy50zx6RPn3bhXS0j1ybNCuLIXzWGqvbedPgqjpd6ozgyrt53Bq+DW6ZSq9wHaqh1 3Uf9CNxJm9X5/m9PD9zMp6SGiFuXupsf747zNpvsqnhB7NgeJ4mx0G0bsyr6LgN6zoP3 OMXcGDDx7wcVZtXQR+AGetTySNuxbGymu+MRi/sXWHLP2eB//qFJQf5OQ3flpAj3IISS 7Q2ptJNSFY44I2llKJCpuMod59ZcyGV5wvoh/0gnU4Zl24MisL9XcQ+qyYwkWzCn8tEZ dFvLYgQHgnYwQnhE1cf4Vu6ANiWa1deifAkXkA2hzpbYhu1igqwZBuYMJdRXUQbfAjpS Qh2A== X-Received: by 10.194.110.135 with SMTP id ia7mr6927138wjb.5.1390488282950; Thu, 23 Jan 2014 06:44:42 -0800 (PST) Received: from stedf17-labo202.ds.jdsu.net. (4-161.80-90.static-ip.oleane.fr. [90.80.161.4]) by mx.google.com with ESMTPSA id fo6sm28320223wib.7.2014.01.23.06.44.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jan 2014 06:44:42 -0800 (PST) From: Jean-Jacques Hiblot To: nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, b.brezillon@overkiz.com Subject: [PATCH] usb: at91-udc: fix irq and iomem resource retrieval Date: Thu, 23 Jan 2014 15:41:42 +0100 Message-Id: <1390488102-8548-1-git-send-email-jjhiblot@traphandler.com> X-Mailer: git-send-email 1.8.5.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140123_094504_922304_DB8807B2 X-CRM114-Status: UNSURE ( 9.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Jean-Jacques Hiblot , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 using dt resources retrieval (interrupts and reg properties) there is no predefined order for these resources in the platform dev resource table. Also don't expect the number of resource to be always 2. Signed-off-by: Jean-Jacques Hiblot Acked-by: Nicolas Ferre Acked-by: Boris BREZILLON --- drivers/usb/gadget/at91_udc.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 4cc4fd6..dfd2943 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1710,16 +1710,6 @@ static int at91udc_probe(struct platform_device *pdev) return -ENODEV; } - if (pdev->num_resources != 2) { - DBG("invalid num_resources\n"); - return -ENODEV; - } - if ((pdev->resource[0].flags != IORESOURCE_MEM) - || (pdev->resource[1].flags != IORESOURCE_IRQ)) { - DBG("invalid resource type\n"); - return -ENODEV; - } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO;