Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666Ab1EILVc (ORCPT ); Mon, 9 May 2011 07:21:32 -0400 Received: from mga01.intel.com ([192.55.52.88]:20799 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080Ab1EILVb (ORCPT ); Mon, 9 May 2011 07:21:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.64,340,1301900400"; d="scan'208";a="690079012" Date: Mon, 9 May 2011 13:21:08 +0200 From: Samuel Ortiz To: linux-kernel Subject: [PATCH 01/19] mfd: Add platform data pointer back Message-ID: <20110509112107.GC8071@sortiz-mobl> References: <1304901131-7104-1-git-send-email-sameo@linux.intel.com> <1304901131-7104-2-git-send-email-sameo@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1304901131-7104-2-git-send-email-sameo@linux.intel.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2722 Lines: 79 Now that we have a way to pass MFD cells down to the sub drivers, we can gradually get rid of mfd_data by putting the platform pointer back in place. Cc: Andres Salomon Cc: Artem Bityutskiy Cc: Dmitry Baryshkov Cc: Dmitry Torokhov Cc: Florian Fainelli Cc: Grant Likely Cc: Guennadi Liakhovetski Cc: Haojian Zhuang Cc: Ian Molton Cc: Ira W. Snyder Cc: Liam Girdwood Cc: Linus Walleij Cc: Mark Brown Cc: Matti Aaltonen Cc: Matt Reimer Cc: Miguel Aguilar Cc: Paul Mundt Cc: Peter Ujfalusi Cc: Philipp Zabel Cc: Richard Purdie Cc: Richard R?jfors Cc: Uwe Kleine-K?nig Cc: Wim Van Sebroeck Cc: Wolfgang Grandegger Signed-off-by: Samuel Ortiz --- drivers/mfd/mfd-core.c | 7 +++++++ include/linux/mfd/core.h | 4 ++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index f4c8c84..0902523 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -88,6 +88,13 @@ static int mfd_add_device(struct device *parent, int id, pdev->dev.parent = parent; + if (cell->pdata_size) { + ret = platform_device_add_data(pdev, + cell->platform_data, cell->pdata_size); + if (ret) + goto fail_res; + } + ret = mfd_platform_add_cell(pdev, cell); if (ret) goto fail_res; diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index aef23309..68c13e5 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -36,6 +36,10 @@ struct mfd_cell { /* mfd_data can be used to pass data to client drivers */ void *mfd_data; + /* platform data passed to the sub devices drivers */ + void *platform_data; + size_t pdata_size; + /* * These resources can be specified relative to the parent device. * For accessing hardware you should use resources from the platform dev -- 1.7.2.3 -- Intel Open Source Technology Centre http://oss.intel.com/ -- 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/