Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753482AbbG0NtP (ORCPT ); Mon, 27 Jul 2015 09:49:15 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:47495 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235AbbG0NtN (ORCPT ); Mon, 27 Jul 2015 09:49:13 -0400 Message-ID: <55B636D4.6020709@roeck-us.net> Date: Mon, 27 Jul 2015 06:49:08 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Matt Fleming , Wim Van Sebroeck CC: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Mika Westerberg , Andy Shevchenko , Jean Delvare , Wolfram Sang , Matt Fleming , Peter Tyser , Samuel Ortiz , Lee Jones Subject: Re: [PATCH 1/5] iTCO_wdt: Expose watchdog properties using platform data References: <1438004292-16382-1-git-send-email-matt@codeblueprint.co.uk> <1438004292-16382-2-git-send-email-matt@codeblueprint.co.uk> In-Reply-To: <1438004292-16382-2-git-send-email-matt@codeblueprint.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2831 Lines: 71 On 07/27/2015 06:38 AM, Matt Fleming wrote: > From: Matt Fleming > > Intel Sunrisepoint (Skylake PCH) has the iTCO watchdog accessible across > the SMBus, unlike previous generations of PCH/ICH where it was on the > LPC bus. Because it's on the SMBus, it doesn't make sense to pass around > a 'struct lpc_ich_info', and leaking the type of bus into the iTCO > watchdog driver is kind of backwards anyway. > > This change introduces a new 'struct iTCO_wdt_platform_data' for use > inside the iTCO watchdog driver and by the upcoming Intel Sunrisepoint > code, which neatly avoids having to include lpc_ich headers in the i801 > i2c driver. > > A simple translation layer is provided for converting from the existing > 'struct lpc_ich_info' inside the lpc_ich mfd driver. > > Cc: Peter Tyser > Cc: Samuel Ortiz > Cc: Lee Jones > Cc: Wim Van Sebroeck > Signed-off-by: Matt Fleming > --- > drivers/mfd/lpc_ich.c | 32 +++++++++++++++++++++++++++++--- > drivers/watchdog/Kconfig | 2 +- > drivers/watchdog/iTCO_wdt.c | 11 +++++------ > include/linux/mfd/lpc_ich.h | 6 ------ > include/linux/platform_data/iTCO_wdt.h | 18 ++++++++++++++++++ > 5 files changed, 53 insertions(+), 16 deletions(-) > create mode 100644 include/linux/platform_data/iTCO_wdt.h > > diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c > index 8de34398abc0..d190b74a6321 100644 > --- a/drivers/mfd/lpc_ich.c > +++ b/drivers/mfd/lpc_ich.c > @@ -66,6 +66,7 @@ > #include > #include > #include > +#include > > #define ACPIBASE 0x40 > #define ACPIBASE_GPE_OFF 0x28 > @@ -835,9 +836,31 @@ static void lpc_ich_enable_pmc_space(struct pci_dev *dev) > priv->actrl_pbase_save = reg_save; > } > > -static void lpc_ich_finalize_cell(struct pci_dev *dev, struct mfd_cell *cell) > +static int lpc_ich_finalize_wdt_cell(struct pci_dev *dev) > { > + struct iTCO_wdt_platform_data *pdata; > struct lpc_ich_priv *priv = pci_get_drvdata(dev); > + struct lpc_ich_info *info; > + struct mfd_cell *cell = &lpc_ich_cells[LPC_WDT]; > + > + pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); > + if (!pdata) > + return -ENOMEM; > + I don't see the platform data freed anywhere, neither in the error path nor in the cleanup path of this driver. Can you use devm_kzalloc() ? Otherwise I think you'll need a cleanup path. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/