Message ID | 1343298534-13611-18-git-send-email-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jul 26, 2012 at 11:28:50AM +0100, Lee Jones wrote: > Here we pass platform registration from platform code over to Device > Tree, when DT is enabled. > - pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); > - platform_device_register(&ux500_pcm); This has the same issue as your last patch... the way you're doing things will break audio on all boards using this driver.
On 26/07/12 12:38, Mark Brown wrote: > On Thu, Jul 26, 2012 at 11:28:50AM +0100, Lee Jones wrote: > >> Here we pass platform registration from platform code over to Device >> Tree, when DT is enabled. > >> - pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); >> - platform_device_register(&ux500_pcm); > > This has the same issue as your last patch... the way you're doing > things will break audio on all boards using this driver. It will, why?
On Thu, Jul 26, 2012 at 02:52:09PM +0100, Lee Jones wrote: > On 26/07/12 12:38, Mark Brown wrote: > >>- pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); > >>- platform_device_register(&ux500_pcm); > >This has the same issue as your last patch... the way you're doing > >things will break audio on all boards using this driver. > It will, why? You've just removed registration of the device and not added anything else to replace that. Even if all boards convert to DT their DTs will need to be updated which you're not doing.
On 26/07/12 15:22, Mark Brown wrote: > On Thu, Jul 26, 2012 at 02:52:09PM +0100, Lee Jones wrote: >> On 26/07/12 12:38, Mark Brown wrote: > >>>> - pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); >>>> - platform_device_register(&ux500_pcm); > >>> This has the same issue as your last patch... the way you're doing >>> things will break audio on all boards using this driver. > >> It will, why? > > You've just removed registration of the device and not added anything > else to replace that. Even if all boards convert to DT their DTs will > need to be updated which you're not doing. The initialisation function which calls platform_device_register() is only executed during a DT boot. The clue is in the title mop500_of_msp_init(). The DT is populated _before_ this patch, but I guess you mean if they are separated into subsystem trees and are placed into -next/Mainline out of order. I will merge these patches with the DT population instead to overcome this possibility. It makes more sense to keep the arch/arm stuff together in any case.
diff --git a/arch/arm/mach-ux500/board-mop500-msp.c b/arch/arm/mach-ux500/board-mop500-msp.c index ce7fff9..890feb3 100644 --- a/arch/arm/mach-ux500/board-mop500-msp.c +++ b/arch/arm/mach-ux500/board-mop500-msp.c @@ -257,9 +257,6 @@ void mop500_of_msp_init(struct device *parent) "could not get MSP1 idlestate\n"); } } - - pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); - platform_device_register(&ux500_pcm); } void mop500_msp_init(struct device *parent) diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index 1a04e24..557da2d 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -304,10 +304,16 @@ static int __devinit ux500_pcm_drv_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id ux500_pcm_match[] = { + { .compatible = "stericsson,ux500-pcm", }, + {}, +}; + static struct platform_driver ux500_pcm_driver = { .driver = { .name = "ux500-pcm", .owner = THIS_MODULE, + .of_match_table = ux500_pcm_match, }, .probe = ux500_pcm_drv_probe,
Here we pass platform registration from platform code over to Device Tree, when DT is enabled. Signed-off-by: Lee Jones <lee.jones@linaro.org> --- arch/arm/mach-ux500/board-mop500-msp.c | 3 --- sound/soc/ux500/ux500_pcm.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-)