From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754752AbbK3PMR (ORCPT ); Mon, 30 Nov 2015 10:12:17 -0500 Received: from mga09.intel.com ([134.134.136.24]:47792 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754711AbbK3PMG (ORCPT ); Mon, 30 Nov 2015 10:12:06 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,364,1444719600"; d="scan'208";a="830966894" From: Andy Shevchenko To: "Rafael J . Wysocki" , Greg Kroah-Hartman , Jarkko Nikula , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Lee Jones , Mika Westerberg , Kevin Fenzi , Arnd Bergmann , Wolfram Sang Cc: Andy Shevchenko Subject: [PATCH v2 12/16] mfd: core: propagate device properties to sub devices drivers Date: Mon, 30 Nov 2015 17:11:40 +0200 Message-Id: <1448896304-87928-13-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448896304-87928-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1448896304-87928-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the similar way like we do for the platform data we propagate the device properties. For example, in case of Intel LPSS drivers we may provide a specific property to tell the actual device driver an additional information such as platform name. Signed-off-by: Andy Shevchenko --- drivers/mfd/mfd-core.c | 7 +++++++ include/linux/mfd/core.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 60b60dc..88bd1b1 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -192,6 +193,12 @@ static int mfd_add_device(struct device *parent, int id, goto fail_alias; } + if (cell->pset) { + ret = platform_device_add_properties(pdev, cell->pset); + if (ret) + goto fail_alias; + } + ret = mfd_platform_add_cell(pdev, cell, usage_count); if (ret) goto fail_alias; diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 27dac3f..bc6f7e0 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -17,6 +17,7 @@ #include struct irq_domain; +struct property_set; /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */ struct mfd_cell_acpi_match { @@ -44,6 +45,10 @@ struct mfd_cell { /* platform data passed to the sub devices drivers */ void *platform_data; size_t pdata_size; + + /* device properties passed to the sub devices drivers */ + const struct property_set *pset; + /* * Device Tree compatible string * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details -- 2.6.2