From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751159AbdAOOyN (ORCPT ); Sun, 15 Jan 2017 09:54:13 -0500 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:52471 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdAOOyM (ORCPT ); Sun, 15 Jan 2017 09:54:12 -0500 From: "Rafael J. Wysocki" To: Guenter Roeck Cc: Len Brown , Pavel Machek , Greg Kroah-Hartman , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Calling device_init_wakeup() on driver removal Date: Sun, 15 Jan 2017 15:49:44 +0100 Message-ID: <3852101.qr97BxrLhj@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0-rc2+; KDE/4.14.9; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday, January 14, 2017 08:46:05 PM Guenter Roeck wrote: > Hi folks, Hi, > while looking through driver initialization and removal functions, I noticed that many drivers > call device_init_wakeup(dev, false) in the removal function. Given that the driver is about > to be removed, that doesn't make much sense to me, especially since device_wakeup_disable() > is called from device_pm_remove() anyway. > > Is it safe to assume that all those calls can be removed, or is there a possible reason for > keeping them around ? Removing them automatically might break things, because device_init_wakeup(dev, false) also clears the power.can_wakeup flag and removes the "wakeup" attribute from sysfs. I guess they could be removed safely in the majority of cases, though. Thanks, Rafael