Re: [PATCH 1/3] mfd: cros_ec: Add Chrome OS EC userspace device interface

From: Javier Martinez Canillas
Date: Thu Nov 20 2014 - 07:13:40 EST


Hello Lee,

On 11/20/2014 12:58 PM, Lee Jones wrote:
>> the printk.h header? to use the pr_* functions but I'll make sure that only
>> the needed headers are included.
>
> Right, I think don't think you should be using those on a platform device.
>

Yes, I'll use dev_err() instead.

>> I prefer macros if possible since they cost nothing and give you an indirection
>> level if you want to change it later. Any reason to not use a define directive?
>
> Exactly as you said, they add a layer of (pointless)
> indirection/complexity. You only use this name once, just change it
> where you use it if you wish to (but probably never will) adapt the
> name.
>

Fair enough, I'll remove it.

>
> I know how the device driver model works. I'm asking where the
> 'device' is registered from, not the 'driver' i.e. platform data, DT,
> ACPI?
>

Right, sorry for misunderstanding your question and the silly comment then.

$Subject adds a "cros-ec-dev" mfd cell to the cros ec mfd driver.
So the device is registered from DT when the cros ec device node is
matched (e.g: "google,cros-ec-spi" or "google,cros-ec-i2c") and the
cros ec mfd driver probe function calls mfd_add_devices().

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/