On 8/25/08, David Brownell <[EMAIL PROTECTED]> wrote:
> My own comments on this:
>
> - I'd like to see at24.c use something running before
> device_initcall, so suitably configured system can
> have drivers calling platform_device_probe() from
> their own initcalls and yet have access to the config
> data from the EEPROMs.
>
> - Seems to me that "struct at24_iface" should be more
> generic ... the same notion works for SPI eeproms,
> NVRAM as found in RTCs, etc.
>
> Comments?
Would it make sense to use bus notifiers to track the detection of a
at24 chip? I have some MMC code in my tree that is using them.
+static int of_mmc_spi_notify(struct notifier_block *nb, unsigned long action,
+ void *_dev)
+{
+ struct device *dev = _dev;
+
+ switch (action) {
+ case BUS_NOTIFY_ADD_DEVICE:
+ return of_mmc_spi_add(dev);
+ case BUS_NOTIFY_DEL_DEVICE:
+ return of_mmc_spi_del(dev);
+ };
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block of_mmc_spi_notifier = {
+ .notifier_call = of_mmc_spi_notify,
+};
+
--
Jon Smirl
[EMAIL PROTECTED]
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c