diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-26 15:06:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-30 12:18:27 +0200 |
commit | 73b0d228e5b00365e7289e9c258acb8de3f716b3 (patch) | |
tree | b17c82b3a4f33d52fdd26c52086e1fa7eaac97a3 /drivers/video/s3c24xx.c | |
parent | 4a4f2f20b8873224983ab9b78173f9bc0564fa33 (diff) | |
download | barebox-73b0d228e5b00365e7289e9c258acb8de3f716b3.tar.gz barebox-73b0d228e5b00365e7289e9c258acb8de3f716b3.tar.xz |
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video/s3c24xx.c')
-rw-r--r-- | drivers/video/s3c24xx.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/s3c24xx.c b/drivers/video/s3c24xx.c index d641cfaa27..c3e05c6cd7 100644 --- a/drivers/video/s3c24xx.c +++ b/drivers/video/s3c24xx.c @@ -321,7 +321,6 @@ static int s3cfb_activate_var(struct fb_info *fb_info) * Print some information about the current hardware state * @param hw_dev S3C video device */ -#ifdef CONFIG_DRIVER_VIDEO_S3C_VERBOSE static void s3cfb_info(struct device_d *hw_dev) { uint32_t con1, addr1, addr2, addr3; @@ -340,7 +339,6 @@ static void s3cfb_info(struct device_d *hw_dev) printf(" Virtual screen offset size: %u half words\n", GET_OFFSIZE(addr3)); printf(" Virtual screen page width: %u half words\n", GET_PAGE_WIDTH(addr3)); } -#endif /* * There is only one video hardware instance available. @@ -390,6 +388,9 @@ static int s3cfb_probe(struct device_d *hw_dev) fbi.passive_display = pdata->passive_display; fbi.enable = pdata->enable; + if (IS_ENABLED(CONFIG_DRIVER_VIDEO_S3C_VERBOSE)) + hw_dev->info = s3cfb_info; + ret = register_framebuffer(&fbi.info); if (ret != 0) { dev_err(hw_dev, "Failed to register framebuffer\n"); @@ -402,9 +403,6 @@ static int s3cfb_probe(struct device_d *hw_dev) static struct driver_d s3cfb_driver = { .name = "s3c_fb", .probe = s3cfb_probe, -#ifdef CONFIG_DRIVER_VIDEO_S3C_VERBOSE - .info = s3cfb_info, -#endif }; device_platform_driver(s3cfb_driver); |