Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156040
b: refs/heads/master
c: 6590981
h: refs/heads/master
v: v3
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Linus Torvalds committed Jul 30, 2009
1 parent ccb5b3e commit 8289f9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57c5c28dbc835c67a9c23912bab56b7f165e7715
refs/heads/master: 659098141d02eb8e3545be8969d262e02d2f3f98
23 changes: 18 additions & 5 deletions trunk/drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,23 +1174,34 @@ static struct platform_driver cmos_platform_driver = {
}
};

#ifdef CONFIG_PNP
static bool pnp_driver_registered;
#endif
static bool platform_driver_registered;

static int __init cmos_init(void)
{
int retval = 0;

#ifdef CONFIG_PNP
pnp_register_driver(&cmos_pnp_driver);
retval = pnp_register_driver(&cmos_pnp_driver);
if (retval == 0)
pnp_driver_registered = true;
#endif

if (!cmos_rtc.dev)
if (!cmos_rtc.dev) {
retval = platform_driver_probe(&cmos_platform_driver,
cmos_platform_probe);
if (retval == 0)
platform_driver_registered = true;
}

if (retval == 0)
return 0;

#ifdef CONFIG_PNP
pnp_unregister_driver(&cmos_pnp_driver);
if (pnp_driver_registered)
pnp_unregister_driver(&cmos_pnp_driver);
#endif
return retval;
}
Expand All @@ -1199,9 +1210,11 @@ module_init(cmos_init);
static void __exit cmos_exit(void)
{
#ifdef CONFIG_PNP
pnp_unregister_driver(&cmos_pnp_driver);
if (pnp_driver_registered)
pnp_unregister_driver(&cmos_pnp_driver);
#endif
platform_driver_unregister(&cmos_platform_driver);
if (platform_driver_registered)
platform_driver_unregister(&cmos_platform_driver);
}
module_exit(cmos_exit);

Expand Down

0 comments on commit 8289f9c

Please sign in to comment.