lkml.org 
[lkml]   [2012]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 12/19] ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use
Date
On Wednesday 22 February 2012, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > But if you change the rtc driver to always bind to the existing
> > "at91_rtt" platform_device and fail the probe() function for the
> > case that you are on at91sam9263 probing the non-RTC device,
> > you should get the exact same result without any extra code
> > in the per-soc files.
>
> agreed but as on at91sam9263 you have 2 RTTs so you can have 2 drivers at the
> same time that use the RTT. So we can not do this except if we set the second
> RTT to an other device name.

Let me rephrase what I meant then:

The first driver should in its probe function do:

if (pdev->id != CONFIG_RTC_DRV_AT91SAM9_RTT)
return -ENODEV;

while the other driver does

if (pdev->id == CONFIG_RTC_DRV_AT91SAM9_RTT)
return -ENODEV;

This way, each driver binds to one device but not the other.
It should even work with an unmodified second driver, as long
as you guarantee that it's loaded after the first one.

Any reason why this won't work?

Arnd


\
 
 \ /
  Last update: 2012-02-22 18:39    [W:0.082 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site