Re: [RFC PATCH 1/4] PLATFORM: introduce structure to bind async platformdata to a dev path name

From: Andy Green
Date: Sun Mar 13 2011 - 13:21:35 EST


On 03/13/2011 04:58 PM, Somebody in the thread at some point said:

So, you want to have a mechanism telling the driver "if the device
happens to have this particular path, use that platform data", right?

Yeah.

And it works because the initialization code kind of knows what path the
device is going to be at, so it can predict that and provide the mathing data.

Unfortunately, this relies on how device paths are constructed at the moment,
so if this approach is adopted in general, it will prevent us from changing
that way in the future (or at least it will make that very difficult).

Perhaps you could use some other kind of device identification here?

I'm sorry what prevents you changing paths in the future?

Nothing does, if you change the bus tag from like usb1 to UsB_1 you just fix up the strings in the board definition files at the same time, they are sitting there in the same tree and

grep platform_async_platform_data arch/* -R

will show them all up in one hit. It's no different if you changed the name of a driver, you'd patch the board definition files with devices that need to bind to that driver name to uplevel them to the new name.

The board definition file for these SoC cases usually has access to a pointer to the host controller directly since it instantiates them, if this was the only stumbling point and you thought it helped something the matching system can look for that particular pointer being a parent of the candidate probed device.

-Andy
--
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/