Skip to contentSkip to conversation

mfd: imanager2: Add Core supports for IT8516/18/28

PATCH Wei-Chun Pan 2 participants 2 messages Aug 7, 2014

lore
Share & tools
lore
#0 lore raw

I have a question for your comment. As your mail,

Quoted 11 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+
+static void __exit imanager2_mfd_device_exit(void) {
+	mfd_remove_devices(&ec_pdev->dev);
+	platform_device_unregister(ec_pdev);
+}
+
+module_init(imanager2_mfd_device_init);
+module_exit(imanager2_mfd_device_exit);

This is a mess. Use module_platform_driver() instead.

Quoted 5 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+MODULE_AUTHOR("Richard Vidal-Dorsch <richard.dorsch at
+advantech.com>");
+MODULE_DESCRIPTION("iManager2 platform device definitions v"
+DRV_VERSION); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION);

How can I use module_platform_driver() and my driver exit function also can do mfd_remove_devices().
Or any other better function install of mfd_remove_devices()?

#1 lore raw

You've replied to this email as an independent message, so now there is little context. When you reply, please ensure your mailer replies to the thread.

Quoted 19 lines · Wei-Chun Pan

I have a question for your comment. As your mail,

Quoted 11 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+
+static void __exit imanager2_mfd_device_exit(void) {
+	mfd_remove_devices(&ec_pdev->dev);
+	platform_device_unregister(ec_pdev);
+}
+
+module_init(imanager2_mfd_device_init);
+module_exit(imanager2_mfd_device_exit);

This is a mess. Use module_platform_driver() instead.

Quoted 5 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+MODULE_AUTHOR("Richard Vidal-Dorsch <richard.dorsch at
+advantech.com>");
+MODULE_DESCRIPTION("iManager2 platform device definitions v"
+DRV_VERSION); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION);
Quoted 3 lines

How can I use module_platform_driver() and my driver exit function also can do mfd_remove_devices().
Or any other better function install of mfd_remove_devices()?

That's the point - you don't do mfd_remove_devices() in exit(), you do mfd_add_devices() in .probe() and mfd_remove_devices() in .remove().

The only thing you want to do in init() is platform_driver_register(), or even better - don't have init() and exit() calls and use use module_platform_driver_probe() instead.

Quoted 1 line

Not sure why you've signed-off on an email?

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog