From patchwork Mon Sep 6 13:46:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 158221 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o86DkloY030381 for ; Mon, 6 Sep 2010 13:46:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750938Ab0IFNqq (ORCPT ); Mon, 6 Sep 2010 09:46:46 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:54399 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768Ab0IFNqp (ORCPT ); Mon, 6 Sep 2010 09:46:45 -0400 Received: by iwn5 with SMTP id 5so4254036iwn.19 for ; Mon, 06 Sep 2010 06:46:44 -0700 (PDT) Received: by 10.231.19.74 with SMTP id z10mr6241270iba.120.1283780804394; Mon, 06 Sep 2010 06:46:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.146.71 with HTTP; Mon, 6 Sep 2010 06:46:24 -0700 (PDT) X-Originating-IP: [46.116.15.195] In-Reply-To: <20100906120716.GE20903@n2100.arm.linux.org.uk> References: <1283376410-9999-1-git-send-email-ohad@wizery.com> <1283376410-9999-4-git-send-email-ohad@wizery.com> <20100906120716.GE20903@n2100.arm.linux.org.uk> From: Ohad Ben-Cohen Date: Mon, 6 Sep 2010 16:46:24 +0300 Message-ID: Subject: Re: [PATCH v5 3/7] wireless: wl12xx: add platform data passing support To: Russell King - ARM Linux Cc: =?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= , linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Kalle Valo , Nicolas Pitre , Tony Lindgren , Mark Brown , Roger Quadros , Ido Yariv , San Mehat , Chikkature Rajashekar Madhusudhan , Luciano Coelho , akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Sep 2010 13:46:49 +0000 (UTC) diff --git a/drivers/net/wireless/wl12xx/wl12xx_platform_data.c b/drivers/net/wireless/wl12xx/wl12xx_platform_data.c new file mode 100644 index 0000000..973b110 --- /dev/null +++ b/drivers/net/wireless/wl12xx/wl12xx_platform_data.c @@ -0,0 +1,28 @@ +#include +#include +#include + +static const struct wl12xx_platform_data *platform_data; + +int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data) +{ + if (platform_data) + return -EBUSY; + if (!data) + return -EINVAL; + + platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); + if (!platform_data) + return -ENOMEM; + + return 0; +} + +const struct wl12xx_platform_data *wl12xx_get_platform_data(void) +{ + if (!platform_data) + return ERR_PTR(-ENODEV); + + return platform_data; +} +EXPORT_SYMBOL(wl12xx_get_platform_data);