Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748Ab3JERq4 (ORCPT ); Sat, 5 Oct 2013 13:46:56 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:38858 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305Ab3JERqy (ORCPT ); Sat, 5 Oct 2013 13:46:54 -0400 MIME-Version: 1.0 In-Reply-To: <1380826284-18381-1-git-send-email-mkl@pengutronix.de> References: <1380826284-18381-1-git-send-email-mkl@pengutronix.de> Date: Sat, 5 Oct 2013 14:46:52 -0300 Message-ID: Subject: Re: [PATCH|RFC] of: let of_match_device() always return best match From: Fabio Estevam To: Marc Kleine-Budde Cc: LKML , linux-arm-kernel , Grant Likely , Rob Herring , "devicetree@vger.kernel.org" , "kernel@pengutronix.de" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2043 Lines: 61 Hi Marc, On Thu, Oct 3, 2013 at 3:51 PM, Marc Kleine-Budde wrote: > For example: > > The imx28.dtsi gives this compatible string for its CAN core: > >> compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan"; > > The flexcan driver defines: > >> static const struct of_device_id flexcan_of_match[] = { >> { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, >> { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, >> { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, >> { /* sentinel */ }, >> }; > > The "p1010" was the first Freescale SoC with the flexcan core. But this SoC has > a bug, so a workaround has to be enabled in the driver. The mx28 has this bug > fixed, so we don't need this quite costly workaround. What about defining in imx28.dtsi: compatible = "fsl,imx28-flexcan". and the in the flexcan driver we could do the same as in the fec_main driver: static struct platform_device_id fec_devtype[] = { { /* keep it for coldfire */ .name = DRIVER_NAME, .driver_data = 0, }, { .name = "imx25-fec", .driver_data = FEC_QUIRK_USE_GASKET, }, { .name = "imx27-fec", .driver_data = 0, }, { .name = "imx28-fec", .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME, }, { .name = "imx6q-fec", .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358, }, { .name = "mvf600-fec", .driver_data = FEC_QUIRK_ENET_MAC, }, { /* sentinel */ } }; So that we know which SoC needs to have the workaround applied or not. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/