From patchwork Thu Jan 17 22:33:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 10769199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2BDC6C2 for ; Thu, 17 Jan 2019 22:34:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E34F72A924 for ; Thu, 17 Jan 2019 22:34:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D76502A938; Thu, 17 Jan 2019 22:34:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61BE02A924 for ; Thu, 17 Jan 2019 22:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbfAQWds (ORCPT ); Thu, 17 Jan 2019 17:33:48 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:34142 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfAQWdr (ORCPT ); Thu, 17 Jan 2019 17:33:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1547764425; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=O2W0ohq1LIQRifQX2S3OaPRnUptWOb9NY2ONW+RNpW4=; b=bZjxv5nLymwQm4ueRERTYnvj4OzxKab9VaGdHS+96UzRD9HwEcpXW4+62ZuDwMRJfVbtSE pwk+XgKmlu9Zg+mjhV/n0PVEa/byH9rKSQlH1IJtmtZciQzQ0+XJSK5kCsE6IwLZB4r1c9 DMOJD2Zej2H2QJqFAZqqUW8tk0IBJWk= From: Paul Cercueil To: Bin Liu Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 2/4] usb: musb: jz4740: Add support for devicetree Date: Thu, 17 Jan 2019 19:33:28 -0300 Message-Id: <20190117223330.16631-2-paul@crapouillou.net> In-Reply-To: <20190117223330.16631-1-paul@crapouillou.net> References: <20190117223330.16631-1-paul@crapouillou.net> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for probing the driver from devicetree. Signed-off-by: Paul Cercueil --- v2: Add MODULE_DEVICE_TABLE and wrap inside CONFIG_OF v3: No change drivers/usb/musb/jz4740.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c index 04d8b2bc205a..a60627bf7be3 100644 --- a/drivers/usb/musb/jz4740.c +++ b/drivers/usb/musb/jz4740.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -188,11 +189,20 @@ static int jz4740_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id jz4740_musb_of_match[] = { + { .compatible = "ingenic,jz4740-musb" }, + {}, +}; +MODULE_DEVICE_TABLE(of, jz4740_musb_of_match); +#endif + static struct platform_driver jz4740_driver = { .probe = jz4740_probe, .remove = jz4740_remove, .driver = { .name = "musb-jz4740", + .of_match_table = of_match_ptr(jz4740_musb_of_match), }, };