On Mon, Jul 15, 2013 at 11:16:19PM +0200, Oliver Schinagl wrote:That's what I thought (and used).With your latest patches for binary attributes and your blog post, IYes, the .group thing should be what is needed here.
thought that you want to create your binary attributes before the probe
function, to avoid the userspace race. To do that, we have two options,
create them in init (ugly?) or fill the .group member if available so it
gets automatically created from the register function.
Because the pointers don't match and I get a null pointer from platform_get_data
Well in my case, I'm using the module_platform_driver() macro whichI don't understand, why not use the platform device that was passed to
expects the struct platform_driver. Platform_driver has a device_driver
member .driver where the .groups is located. Great, using that works and
we should have the sysfs entry race-free. However I don't know hot to
exchange data between that and the rest of my driver.
Before I used to_platform_device(kobj_to_dev(kobj)) as passed via the
.read function to obtain a platform_device where i could use
platform_get_drvdata on. All was good, but that doesn't fly now and my
knowledge is a bit short as to why.
the binary attribute write function?
I think that's a little above my grasp :p
The second method is finding some other shared structure given that weIt should be, why isn't it?
get a platform_device in the probe function, yet I couldn't find
anything and this platform_device isn't the same as the one from the .read.
Should, but doesn't :(
Of course using a global var bypasses this issue, but I'm sure it won'tThe platform device structure should have what you need, right?
pass review ;)
I don't know :( But i'll add the relevant sections with printk results below, which I should have done before, then again those printk's were not supposed to be in that e-mail to begin with ;)
So using these new patches for binary attributes, how can I pass dataHow is the platform device not the same thing that was passed to your
between my driver and the sysfs files using a platform_driver? Or are
other 'hacks' needed and using the .groups attribute from
platform_driver->device_driver->groups is really the wrong approach.
I did ask around and still haven't figured it out so far, so I do
apologize if you feel I'm wasting your precious time.
probe function?