From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757445AbaHGKBq (ORCPT ); Thu, 7 Aug 2014 06:01:46 -0400 Received: from mail-ig0-f169.google.com ([209.85.213.169]:60085 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756800AbaHGKBp (ORCPT ); Thu, 7 Aug 2014 06:01:45 -0400 Date: Thu, 7 Aug 2014 11:01:39 +0100 From: Lee Jones To: Wei-Chun Pan Cc: Samuel Ortiz , Jean Delvare , Guenter Roeck , Wolfram Sang , "Louis.Lu" , "Neo.Lo" , "Hank.Peng" , "Kevin.Ong" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] mfd: imanager2: Add Core supports for IT8516/18/28 Message-ID: <20140807100139.GE10136@lee--X1> References: <1407404875-3705-1-git-send-email-weichun.pan@advantech.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1407404875-3705-1-git-send-email-weichun.pan@advantech.com.tw> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. On Thu, 07 Aug 2014, Wei-Chun Pan wrote: > I have a question for your comment. As your mail, > > > > + > > > +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. > > > > > +MODULE_AUTHOR("Richard Vidal-Dorsch > > +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()? 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. > Signed-off-by: Wei-Chun Pan Not sure why you've signed-off on an email? -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog