From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbdAYQ2l (ORCPT ); Wed, 25 Jan 2017 11:28:41 -0500 Received: from mga02.intel.com ([134.134.136.20]:46344 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbdAYQ2k (ORCPT ); Wed, 25 Jan 2017 11:28:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="217538986" Message-ID: <1485361713.2133.327.camel@linux.intel.com> Subject: Re: [char-misc-next V2] mei: simplify error handling via devres function. From: Andy Shevchenko To: Tomas Winkler , Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org Date: Wed, 25 Jan 2017 18:28:33 +0200 In-Reply-To: <1485361516-5450-1-git-send-email-tomas.winkler@intel.com> References: <1485361516-5450-1-git-send-email-tomas.winkler@intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-01-25 at 18:25 +0200, Tomas Winkler wrote: > Use devm_ and pcim_ functions to make error handling > simpler and code smaller and tidier. > > Based on original patch by > mei: me: use managed functions pcim_* and devm_* > Andy Shevchenko > https://lkml.org/lkml/2016/2/1/339 > Thanks for an update! > Cc: Andy Shevchenko One nitpick below and please use my SoB instead of Cc here. And you may remove my name above in the commit message (You might leave a link if you want to) >     2. Revert pcim irq reservation change. Noticed that in my origin patch it wasn't touched. >  disable_msi: >   pci_disable_msi(pdev); But this one in error path of ->probe() and below in ->remove() can be removed. pcim_release() will take care of it. (request_threaded_irq() and free_irq() must be left untouched, indeed) In suspend/resume you would use it if you want to, though I don't know if it makes any difference. >   free_irq(pdev->irq, dev); >   pci_disable_msi(pdev); Ditto for the second module, pci_disable_msi() can be safely removed. (System sleep case is a separate one and perhaps needs additional testing, thus, up to you) >  release_irq: >  free_irq(pdev->irq, dev); >   pci_disable_msi(pdev); >  free_irq(pdev->irq, dev); >   pci_disable_msi(pdev); -- Andy Shevchenko Intel Finland Oy