diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-06 19:58:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-06 19:58:38 -0500 |
commit | 6adfd34e85d6ddcf56a652a3dccb26f76aff8fd9 (patch) | |
tree | f9ad06331673b982663f343bb08844c787e8a51b /drivers/video/gbefb.c | |
parent | b54a063df48cb1296f744b5ba456c45ce7efff35 (diff) | |
parent | 2c119aa8091a15a87920f09aa0f17e05960fe11b (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Diffstat (limited to 'drivers/video/gbefb.c')
-rw-r--r-- | drivers/video/gbefb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 316bfe994811..ed853bef19e9 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -1260,24 +1260,30 @@ static struct device_driver gbefb_driver = { | |||
1260 | .remove = __devexit_p(gbefb_remove), | 1260 | .remove = __devexit_p(gbefb_remove), |
1261 | }; | 1261 | }; |
1262 | 1262 | ||
1263 | static struct platform_device gbefb_device = { | 1263 | static struct platform_device *gbefb_device; |
1264 | .name = "gbefb", | ||
1265 | }; | ||
1266 | 1264 | ||
1267 | int __init gbefb_init(void) | 1265 | int __init gbefb_init(void) |
1268 | { | 1266 | { |
1269 | int ret = driver_register(&gbefb_driver); | 1267 | int ret = driver_register(&gbefb_driver); |
1270 | if (!ret) { | 1268 | if (!ret) { |
1271 | ret = platform_device_register(&gbefb_device); | 1269 | gbefb_device = platform_device_alloc("gbefb", 0); |
1272 | if (ret) | 1270 | if (gbefb_device) { |
1271 | ret = platform_device_add(gbefb_device); | ||
1272 | } else { | ||
1273 | ret = -ENOMEM; | ||
1274 | } | ||
1275 | if (ret) { | ||
1276 | platform_device_put(gbefb_device); | ||
1273 | driver_unregister(&gbefb_driver); | 1277 | driver_unregister(&gbefb_driver); |
1278 | } | ||
1274 | } | 1279 | } |
1275 | return ret; | 1280 | return ret; |
1276 | } | 1281 | } |
1277 | 1282 | ||
1278 | void __exit gbefb_exit(void) | 1283 | void __exit gbefb_exit(void) |
1279 | { | 1284 | { |
1280 | driver_unregister(&gbefb_driver); | 1285 | platform_device_unregister(gbefb_device); |
1286 | driver_unregister(&gbefb_driver); | ||
1281 | } | 1287 | } |
1282 | 1288 | ||
1283 | module_init(gbefb_init); | 1289 | module_init(gbefb_init); |