From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510AbbANPBU (ORCPT ); Wed, 14 Jan 2015 10:01:20 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:54951 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752957AbbANPBQ convert rfc822-to-8bit (ORCPT ); Wed, 14 Jan 2015 10:01:16 -0500 X-AuditID: cbfee61b-f79d76d0000024d6-cf-54b684b9a763 Date: Wed, 14 Jan 2015 16:01:06 +0100 From: Lukasz Majewski To: Eduardo Valentin Cc: Kamil Debski , Jean Delvare , Guenter Roeck , lm-sensors@lm-sensors.org, Linux PM list , "linux-samsung-soc@vger.kernel.org" , devicetree@vger.kernel.org, Lukasz Majewski , Kukjin Kim , linux-kernel@vger.kernel.org, Sylwester Nawrocki , Abhilash Kesavan , Abhilash Kesavan Subject: Re: [PATCH v2 1/8] thermal: Provide stub for thermal_of_cooling_device_register() function Message-id: <20150114160106.20aa160b@amdc2363> In-reply-to: <20150102190339.GA22356@developer> References: <1418897591-18332-1-git-send-email-l.majewski@samsung.com> <1419265668-32283-1-git-send-email-l.majewski@samsung.com> <1419265668-32283-2-git-send-email-l.majewski@samsung.com> <20150102185426.GC12485@developer> <20150102190339.GA22356@developer> Organization: SPRC Poland X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8BIT X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsVy+t9jAd2dLdtCDK7MsLF4vGYxk8X8I+dY LeZfucZqsfTuJzaLH68vsFms+atk0bvgKpvFm0fcFpd3zWGz+Nx7hNFixvl9TBZPFp5hsrgz bS+bxeE37awOfB47Z91l93gwcTebx7ppb5k9dn5vYPfo27KK0WPz6WqPz5vkAtijuGxSUnMy y1KL9O0SuDKWtq1mL5ikWPG99QNTA+M3qS5GTg4JAROJAw9eMEHYYhIX7q1nA7GFBBYxSny8 5Q9h/2KUePeiEsRmEVCVuL9+K1gNm4CexOe7T8F6RQS0JE5c2g5kc3EwC0xjkVh9vZcdJCEs kCpx+e5msAZeoIbVk1tZuxg5ODgF9CXWfpcHqRcS6GCSmDqlA2wQv4CkRPu/H8wQB9lJnPu0 gR2iV1Dix+R7LCA2s4C6xKR5i5ghbG2JJ+8usE5gFJyFpGwWkrJZSMoWMDKvYhRNLUguKE5K zzXSK07MLS7NS9dLzs/dxAiOqGfSOxhXNVgcYhTgYFTi4XU4sjVEiDWxrLgy9xCjBAezkgjv 0/JtIUK8KYmVValF+fFFpTmpxYcYpTlYlMR5lezbQoQE0hNLUrNTUwtSi2CyTBycUg2MTPtE 7/7pnT2xqdvR8lzkYvNb19/ZpxZ/71adPXXH2nVcNzel6fqkZ1uInOt4+jRx6pSL/+9+Yt5g zHL0t4HgxA1t4d8XOk9NWJ6iofz+oMeyfReeV+kb+q7v5f/+ZXPI/osfDQOtIm25vU4k/bje weq8/4pumz6n2NYvopfcXq5ccfNGIHPudCWW4oxEQy3mouJEALyxwCakAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eduardo, > On Fri, Jan 02, 2015 at 02:54:28PM -0400, Eduardo Valentin wrote: > > On Mon, Dec 22, 2014 at 05:27:41PM +0100, Lukasz Majewski wrote: > > > Odroid U3 fan can work without being registered as OF cooling > > > device (with CONFIG_THERMAL_OF disabled). > > > In this situation it can be controlled via PWM entry at > > > /sys/class/hwmon/hwmon0/pwm1. > > > > > > Therefore, the thermal_of_cooling_device_register() function > > > needs a stub to allow clean compilation. > > > > > > Signed-off-by: Lukasz Majewski > > > > Acked-by: Eduardo Valentin > > Sorry, too fast, > > This is actually > Nacked-by: Eduardo Valentin > > :-) > > I get this error: > drivers/thermal/thermal_core.c:1210:1: error: redefinition of > ‘thermal_of_cooling_device_register’ > thermal_of_cooling_device_register(struct device_node *np, > ^ > In file included from drivers/thermal/thermal_core.c:34:0: > include/linux/thermal.h:321:1: note: previous definition of > ‘thermal_of_cooling_device_register’ was here > thermal_of_cooling_device_register(struct device_node *np, > ^ > > > We provide the function in thermal core even if CONFIG_THERMAL_OF is > not set. Unfortunately the PWM fan subsystem can work perfectly fine without CONFIG_THERMAL. I think that it would be enough to make something like this in the ./include/linux/thermal.h: #ifdef CONFIG_THERMAL static inline struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { return NULL; } #else [ already present declaration of thermal_of_cooling_device_register() ] #endif /* CONFIG_THERMAL */ > > > > > --- > > > Changes for v2: > > > - None > > > --- > > > include/linux/thermal.h | 14 +++++++++++--- > > > 1 file changed, 11 insertions(+), 3 deletions(-) > > > > > > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > > > index 2de3d9e..871123c 100644 > > > --- a/include/linux/thermal.h > > > +++ b/include/linux/thermal.h > > > @@ -328,6 +328,10 @@ thermal_zone_of_sensor_register(struct > > > device *dev, int id, void *data, const struct > > > thermal_zone_of_device_ops *ops); void > > > thermal_zone_of_sensor_unregister(struct device *dev, struct > > > thermal_zone_device *tz); +struct thermal_cooling_device * > > > +thermal_of_cooling_device_register(struct device_node *np, > > > + char *type, void *devdata, > > > + const struct > > > thermal_cooling_device_ops *); #else > > > static inline struct thermal_zone_device * > > > thermal_zone_of_sensor_register(struct device *dev, int id, void > > > *data, @@ -342,6 +346,13 @@ void > > > thermal_zone_of_sensor_unregister(struct device *dev, { > > > } > > > > > > +static inline struct thermal_cooling_device * > > > +thermal_of_cooling_device_register(struct device_node *np, > > > + char *type, void *devdata, > > > + const struct > > > thermal_cooling_device_ops *ops) +{ > > > + return NULL; > > > +} > > > #endif > > > struct thermal_zone_device *thermal_zone_device_register(const > > > char *, int, int, void *, struct thermal_zone_device_ops *, > > > @@ -357,9 +368,6 @@ void thermal_zone_device_update(struct > > > thermal_zone_device *); > > > struct thermal_cooling_device > > > *thermal_cooling_device_register(char *, void *, const struct > > > thermal_cooling_device_ops *); -struct thermal_cooling_device * > > > -thermal_of_cooling_device_register(struct device_node *np, char > > > *, void *, > > > - const struct > > > thermal_cooling_device_ops *); void > > > thermal_cooling_device_unregister(struct thermal_cooling_device > > > *); struct thermal_zone_device > > > *thermal_zone_get_zone_by_name(const char *name); int > > > thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned > > > long *temp); -- 2.0.0.rc2 > > > > > -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group