From patchwork Thu Jan 23 14:40:40 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: 3529351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2894CC02DC for ; Thu, 23 Jan 2014 14:45:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EAE12015D for ; Thu, 23 Jan 2014 14:45:20 +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 6CA57201BF for ; Thu, 23 Jan 2014 14:45:14 +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 1W6LWj-0002Mq-Uh; Thu, 23 Jan 2014 14:45:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W6LWh-0002jq-GJ; Thu, 23 Jan 2014 14:45:03 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W6LWe-0002i4-D9 for linux-arm-kernel@lists.infradead.org; Thu, 23 Jan 2014 14:45:01 +0000 Received: by mail-we0-f174.google.com with SMTP id x55so1276758wes.33 for ; Thu, 23 Jan 2014 06:44:34 -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=GE4RNUqW8bP9bWXyKUslGFraqjNgB2uX4OsFtiFy0gYhMmBXsLlJdxFjvIE2Ze5Giv Sg5wuSoKPiy4780+v0dNj2wkyYBkIilTeLN3t1yGXiv9BqKR3+ppMq/5twX4CCOiUAaN SJJtt8bKY79smIV4Cd717JckQBFrWmLFsPCVo9abSrSZmh+BO7eLJdCrjmxwl4SWmJCW kdmnIzFeL3vZLq8mcDwfrt0Ewv1ecAwQ5RFlXnAHZ4REYb4TdcI+7mUELH/Dbinz8Vo3 5DbDCQ0c+KFGQg5RIPqKfl2XFElfyVUe5InLqploL87kLdRiRzUlOmhZooqmpKhVR8ep np3Q== X-Received: by 10.181.12.76 with SMTP id eo12mr8120567wid.19.1390488274680; Thu, 23 Jan 2014 06:44:34 -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 n3sm28307132wix.10.2014.01.23.06.44.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jan 2014 06:44:33 -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:40:40 +0100 Message-Id: <1390488040-8482-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_094500_532644_6CAC4F49 X-CRM114-Status: UNSURE ( 9.18 ) 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 --- 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;