Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbcCUIgR (ORCPT ); Mon, 21 Mar 2016 04:36:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:52413 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667AbcCUIgI (ORCPT ); Mon, 21 Mar 2016 04:36:08 -0400 Message-ID: <1458549361.2299.1.camel@suse.com> Subject: Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM From: Oliver Neukum To: Geert Uytterhoeven Cc: Woojung Huh , Microchip Linux Driver Support , "David S. Miller" , Guenter Roeck , "Rafael J. Wysocki" , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 21 Mar 2016 09:36:01 +0100 In-Reply-To: <1458470636-18986-1-git-send-email-geert@linux-m68k.org> References: <1458470636-18986-1-git-send-email-geert@linux-m68k.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 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 Content-Length: 914 Lines: 27 On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote: > If CONFIG_PM=n: > > drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: > drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no > member named ‘runtime_auto’ > > If PM is disabled, the runtime_auto flag is not available, but auto > suspend is not enabled anyway. Hence protect the check for > runtime_auto > by #ifdef CONFIG_PM to fix this. > > Fixes: a59f8c5b048dc938 ("lan78xx: add ndo_get_stats64") > Reported-by: Guenter Roeck > Signed-off-by: Geert Uytterhoeven > --- > Alternatively, we can add a dev_pm_runtime_auto_is_enabled() wrapper > to > include/linux/pm.h, which always return false if CONFIG_PM is > disabled. That is what we do for almost everything else in include/pm_runtime.h So it is the best solution to add the stub. Regards Oliver