Skip to content

Commit

Permalink
laba-dta: nunchuk driver: fix __init annotations
Browse files Browse the repository at this point in the history
There is no reason to have wiichuck_probe and wiichuck_match_table in the
init sections as the driver may be bound and unbound at runtime and this
would lead to a crash.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
  • Loading branch information
alexandrebelloni committed Jun 9, 2020
1 parent 2d315f3 commit f1e3495
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -339,7 +339,7 @@ index 000000000000..939cf0c27100
+ wiichuck->poll_dev->poll_interval = WIICHUCK_POLL_PERIOD;
+}
+
+static int __init wiichuck_probe(struct i2c_client *client,
+static int wiichuck_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct wiichuck_device *wiichuck;
Expand Down Expand Up @@ -451,7 +451,7 @@ index 000000000000..939cf0c27100
+MODULE_DEVICE_TABLE(i2c, wiichuck_id);
+
+#ifdef CONFIG_OF
+static const struct of_device_id wiichuck_match_table[] __initdata = {
+static const struct of_device_id wiichuck_match_table[] = {
+ { .compatible = "nintendo,wiimote-extension", },
+ { }
+};
Expand Down
Expand Up @@ -338,7 +338,7 @@ index 000000000000..865f5ca9d941
+ wiichuck->poll_dev->poll_interval = WIICHUCK_POLL_PERIOD;
+}
+
+static int __init wiichuck_probe(struct i2c_client *client,
+static int wiichuck_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct wiichuck_device *wiichuck;
Expand Down Expand Up @@ -450,7 +450,7 @@ index 000000000000..865f5ca9d941
+MODULE_DEVICE_TABLE(i2c, wiichuck_id);
+
+#ifdef CONFIG_OF
+static struct of_device_id wiichuck_match_table[] = {
+static const struct of_device_id wiichuck_match_table[] = {
+ { .compatible = "nintendo,wiimote-extension", },
+ { }
+};
Expand All @@ -468,7 +468,7 @@ index 000000000000..865f5ca9d941
+ .id_table = wiichuck_id,
+};
+
+static int wiichuck_init(void)
+static int __init wiichuck_init(void)
+{
+ return i2c_add_driver(&wiichuck_driver);
+}
Expand Down
Expand Up @@ -338,7 +338,7 @@ index 000000000000..ea7a1e078f2c
+ wiichuck->poll_dev->poll_interval = WIICHUCK_POLL_PERIOD;
+}
+
+static int __init wiichuck_probe(struct i2c_client *client,
+static int wiichuck_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct wiichuck_device *wiichuck;
Expand Down Expand Up @@ -450,7 +450,7 @@ index 000000000000..ea7a1e078f2c
+MODULE_DEVICE_TABLE(i2c, wiichuck_id);
+
+#ifdef CONFIG_OF
+static struct of_device_id wiichuck_match_table[] __initdata = {
+static const struct of_device_id wiichuck_match_table[] = {
+ { .compatible = "nintendo,wiimote-extension", },
+ { }
+};
Expand Down

0 comments on commit f1e3495

Please sign in to comment.