From 73b0d228e5b00365e7289e9c258acb8de3f716b3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sun, 26 May 2013 15:06:53 +0200 Subject: driver: Attach info callback to device, not to driver Since the info is device specific and not driver specific, attach the callback to the device. This makes it possible to have a info callback for a device which does not have a driver attached. Signed-off-by: Sascha Hauer --- arch/sandbox/board/hostfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c index 48c6ea35a8..ac29cfa47a 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -77,6 +77,9 @@ static int hf_probe(struct device_d *dev) priv->cdev.size = hf->size; priv->cdev.ops = &hf_fops; priv->cdev.priv = hf; + + dev->info = hf_info; + #ifdef CONFIG_FS_DEVFS devfs_create(&priv->cdev); #endif @@ -87,7 +90,6 @@ static int hf_probe(struct device_d *dev) static struct driver_d hf_drv = { .name = "hostfile", .probe = hf_probe, - .info = hf_info, }; device_platform_driver(hf_drv); @@ -111,4 +113,3 @@ int barebox_register_filedev(struct hf_platform_data *hf) return sandbox_add_device(dev); } - -- cgit v1.2.3