* [PATCH] mac80211_hwsim: correctly register the platform driver
@ 2013-04-24 4:40 Sasha Levin
2013-04-24 10:53 ` Martin Pitt
[not found] ` <1366778405-7584-1-git-send-email-sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2013-04-24 4:40 UTC (permalink / raw)
To: johannes
Cc: martin.pitt, linville, linux-wireless, netdev, linux-kernel, dcbw,
Sasha Levin
Not registering a platform_driver would make us access garbage
when the platform callbacks under driver_register() kicks in.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
drivers/net/wireless/mac80211_hwsim.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b878a32..cb34c78 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1723,11 +1723,11 @@ static void mac80211_hwsim_free(void)
class_destroy(hwsim_class);
}
-
-static struct device_driver mac80211_hwsim_driver = {
- .name = "mac80211_hwsim",
- .bus = &platform_bus_type,
- .owner = THIS_MODULE,
+static struct platform_driver mac80211_hwsim_driver = {
+ .driver = {
+ .name = "mac80211_hwsim",
+ .owner = THIS_MODULE,
+ },
};
static const struct net_device_ops hwsim_netdev_ops = {
@@ -2219,7 +2219,7 @@ static int __init init_mac80211_hwsim(void)
spin_lock_init(&hwsim_radio_lock);
INIT_LIST_HEAD(&hwsim_radios);
- err = driver_register(&mac80211_hwsim_driver);
+ err = platform_driver_register(&mac80211_hwsim_driver);
if (err)
return err;
@@ -2254,7 +2254,7 @@ static int __init init_mac80211_hwsim(void)
err = -ENOMEM;
goto failed_drvdata;
}
- data->dev->driver = &mac80211_hwsim_driver;
+ data->dev->driver = &mac80211_hwsim_driver.driver;
err = device_bind_driver(data->dev);
if (err != 0) {
printk(KERN_DEBUG
@@ -2564,7 +2564,7 @@ failed_drvdata:
failed:
mac80211_hwsim_free();
failed_unregister_driver:
- driver_unregister(&mac80211_hwsim_driver);
+ platform_driver_unregister(&mac80211_hwsim_driver);
return err;
}
module_init(init_mac80211_hwsim);
@@ -2577,6 +2577,6 @@ static void __exit exit_mac80211_hwsim(void)
mac80211_hwsim_free();
unregister_netdev(hwsim_mon);
- driver_unregister(&mac80211_hwsim_driver);
+ platform_driver_unregister(&mac80211_hwsim_driver);
}
module_exit(exit_mac80211_hwsim);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211_hwsim: correctly register the platform driver
2013-04-24 4:40 [PATCH] mac80211_hwsim: correctly register the platform driver Sasha Levin
@ 2013-04-24 10:53 ` Martin Pitt
[not found] ` <1366778405-7584-1-git-send-email-sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
1 sibling, 0 replies; 3+ messages in thread
From: Martin Pitt @ 2013-04-24 10:53 UTC (permalink / raw)
To: Sasha Levin
Cc: johannes, linville, linux-wireless, netdev, linux-kernel, dcbw
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
Hello Sasha,
Sasha Levin [2013-04-24 0:40 -0400]:
> Not registering a platform_driver would make us access garbage
> when the platform callbacks under driver_register() kicks in.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Ah, thanks for catching this! I applied that patch and verified that
it still works well.
Tested-By: Martin Pitt <martin.pitt@ubuntu.com>
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211_hwsim: correctly register the platform driver
[not found] ` <1366778405-7584-1-git-send-email-sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2013-04-24 10:56 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2013-04-24 10:56 UTC (permalink / raw)
To: Sasha Levin
Cc: martin.pitt-GeWIH/nMZzLQT0dZR+AlfA,
linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, dcbw-H+wXaHxf7aLQT0dZR+AlfA
On Wed, 2013-04-24 at 00:40 -0400, Sasha Levin wrote:
> Not registering a platform_driver would make us access garbage
> when the platform callbacks under driver_register() kicks in.
Applied, thanks.
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-24 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 4:40 [PATCH] mac80211_hwsim: correctly register the platform driver Sasha Levin
2013-04-24 10:53 ` Martin Pitt
[not found] ` <1366778405-7584-1-git-send-email-sasha.levin-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-04-24 10:56 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).