From patchwork Mon Sep 25 23:09:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9970627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA30F60365 for ; Mon, 25 Sep 2017 23:09:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDEF228D0A for ; Mon, 25 Sep 2017 23:09:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2D4928D11; Mon, 25 Sep 2017 23:09:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FEB028D12 for ; Mon, 25 Sep 2017 23:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754090AbdIYXJk (ORCPT ); Mon, 25 Sep 2017 19:09:40 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:47578 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753950AbdIYXJj (ORCPT ); Mon, 25 Sep 2017 19:09:39 -0400 Received: by mail-pf0-f172.google.com with SMTP id u12so4587460pfl.4 for ; Mon, 25 Sep 2017 16:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oJv4Ouf7w/Vk99FdAxnFDF0cMTOvZZJ2MLu4axbwRKE=; b=flkKVVXf2kSgJJmoS9UKpGD/q5NDrMjyWQKUHSAYLQc445BM5rYExHJwTlO7l2BiNJ oH+cBJva3hTopR3wdkb4DlHPjPiSOTud0Pu98Et1es+thhSalurI+dE0BR42knYrRJxk v32CWIkIzhKbzqId2qpW74wfFWdShQyf8R/BE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oJv4Ouf7w/Vk99FdAxnFDF0cMTOvZZJ2MLu4axbwRKE=; b=jdpBR9DeETnttZC7cw5iqll/CuqKURdtZy8/iSgWBVOcYfoJ7cQHLMSV0dWwskP1rm eiD5hJAlyWEw9dLLSXPBZ7IjqEm7ELtgWOxr+LvFJtgD3xjuhNfehSKqvplb18T+sDXl XK+mXcB39oviShlF2qdOi+e6f+vFA11LNIGipa0cw10Ouymxq35SKToLmgMPTu9He315 EMYjNNUpJWu3GUqFHE6TMxWVp2Hr8dWewzAVFn9q5BynPidg6DAQZPL6E52ju3PzL2Co NqqhvYdRuKFtLIZVYgp1xnCY/EqDIu7I5bVFcetFi8GjG5ypzpOkIONZEh7DFhuOghoh TXZQ== X-Gm-Message-State: AHPjjUg9sCQa+o9DimKhmFBZfB7NAppEQR9NiKBEtA7ZFwNOkNa1aXoK fpRqbGiKeYNVSmmMxYfJfvtFmQ== X-Google-Smtp-Source: AOwi7QDeqVRfN0Jh8zo5ZhP3q8JVO7AbpuPB6fI2y9FueQ0SUKHXVgVmNtjO1feiQCyhCGyIf8juFQ== X-Received: by 10.98.150.27 with SMTP id c27mr9113663pfe.123.1506380979033; Mon, 25 Sep 2017 16:09:39 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id a7sm12284532pgc.40.2017.09.25.16.09.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 16:09:38 -0700 (PDT) From: Linus Walleij To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Nishanth Menon , Simon Guinot , Jamie Lentin , Linus Walleij Subject: [PATCH 3/9] hwmon: gpio-fan: Localize platform data Date: Tue, 26 Sep 2017 01:09:05 +0200 Message-Id: <20170925230911.20824-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170925230911.20824-1-linus.walleij@linaro.org> References: <20170925230911.20824-1-linus.walleij@linaro.org> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is not a single user of the platform data header in . We can conclude that all current users are probing from the device tree, so start simplifying the code by pulling the header into the driver. Convert "unsigned" to "unsigned int" in the process to make checkpatch happy. Signed-off-by: Linus Walleij --- drivers/hwmon/gpio-fan.c | 23 ++++++++++++++++++++++- include/linux/gpio-fan.h | 36 ------------------------------------ 2 files changed, 22 insertions(+), 37 deletions(-) delete mode 100644 include/linux/gpio-fan.h diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index f29cee9398ef..cfa8d9b578dd 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -30,12 +30,33 @@ #include #include #include -#include #include #include #include #include +struct gpio_fan_alarm { + unsigned int gpio; + unsigned int active_low; +}; + +struct gpio_fan_speed { + int rpm; + int ctrl_val; +}; + +struct gpio_fan_platform_data { + int num_ctrl; + unsigned int *ctrl; /* fan control GPIOs. */ + struct gpio_fan_alarm *alarm; /* fan alarm GPIO. */ + /* + * Speed conversion array: rpm from/to GPIO bit field. + * This array _must_ be sorted in ascending rpm order. + */ + int num_speed; + struct gpio_fan_speed *speed; +}; + struct gpio_fan_data { struct platform_device *pdev; struct device *hwmon_dev; diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h deleted file mode 100644 index 096659169215..000000000000 --- a/include/linux/gpio-fan.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * include/linux/gpio-fan.h - * - * Platform data structure for GPIO fan driver - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef __LINUX_GPIO_FAN_H -#define __LINUX_GPIO_FAN_H - -struct gpio_fan_alarm { - unsigned gpio; - unsigned active_low; -}; - -struct gpio_fan_speed { - int rpm; - int ctrl_val; -}; - -struct gpio_fan_platform_data { - int num_ctrl; - unsigned *ctrl; /* fan control GPIOs. */ - struct gpio_fan_alarm *alarm; /* fan alarm GPIO. */ - /* - * Speed conversion array: rpm from/to GPIO bit field. - * This array _must_ be sorted in ascending rpm order. - */ - int num_speed; - struct gpio_fan_speed *speed; -}; - -#endif /* __LINUX_GPIO_FAN_H */