From patchwork Mon Nov 16 14:05:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7627441 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 660E69F1C2 for ; Mon, 16 Nov 2015 14:08:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B085C204FB for ; Mon, 16 Nov 2015 14:08:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B828204EA for ; Mon, 16 Nov 2015 14:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbbKPOFt (ORCPT ); Mon, 16 Nov 2015 09:05:49 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:49399 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbbKPOF1 (ORCPT ); Mon, 16 Nov 2015 09:05:27 -0500 Received: from wuerfel.lan. ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0Lmyqm-1aaiZK2ItI-00h7UN; Mon, 16 Nov 2015 15:05:22 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Johnny Kim , Austin Shin , Chris Park , Tony Cho , Glen Lee , Leo Kim , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 12/19] staging/wilc1000: use device pointer for phy creation Date: Mon, 16 Nov 2015 15:05:03 +0100 Message-Id: <1447682710-2908925-13-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1447682710-2908925-1-git-send-email-arnd@arndb.de> References: <1447682710-2908925-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Fmd2j4pPpkAYbMNAgdhr32unYW8pc4PJ2LuWIZVfosDCVNOQQPO 76n7Al+bZFQEGW2O9GI7ihhDhdSylyY/F395i0GfxarVojQoaU/y20EyTYeV/FIxdqtHGME 9jREon4e8EHe3jQH0g0zfGIG+gos3qD107An9UBGg0hDodqXJNQML3oMNb0dcEF0GlA78cB 49x+yrYe/uZUCkd6LXaUQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:7ygkuTWgw5k=:i9/fnUk0bhL8lAplYrxUNO I3IX+2XqPP56awD0z60Rqb//uBzTrWUKvDii5+YGFIyrQDLbO03InknAFg2oywRyUrL3xilRF zl8U3c+0iGCSie2fBarS5kn9cCbVCztmOKv16BEZ8NYGXEXoCC2lnI5xngNSaTiWualkqrwis 2s5Fhhmq9TT0/bJ4AWxNGnwX2BGbA7GcZnj6eUkEUG6Pk61ZGregfz4mQJgZW0PWB8Br4uT75 zaq/S0KkHxYo7Piahm7W6H0nvsXI7ODYIhrnngIbVl9/4dCnVMNP4Au8JcUIG7IdfaXx1zXq+ ntFm9/a9+TR1LNmfWmGe55Ie0/LrXaViFIfoRHOKzB7bLzhDMfwL1WNP+20T9/xO8uD+oK61W gJRi6dI/CswX/7P589qDPHfhYHDFesUuAI4/yrzDtuCF0lxMyCATtzm/q8d2PtLlhdZORsh6+ nos1gX4Get9MwNYneCMWDvtfxuCYgyKXU96cu2vPNhVmjfV6iv/KOPX+tPaIQTBiYmOtssUZx UI74twZ5q1zffbQuYJPWY5UItZwLsdF65lBGbtLB/wi41IZnTZ0lUd9bobvpSOBEVydEC6wo0 j6uO7ybNIND/BkHtWlMY6ZTYNZXLv932n14dgU4SM5QcTTs6JRFpLzFqGDboJ8ELf3cprNWk7 EHUXgBKMfYM4V1X7bJoILPqRAQDeUnRrqUxYzeXyxHgIjONkkHGwGx9P+S3toOSYIsXQ= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP wilc_create_wiphy tries to get a pointer to a device from the global wilc_sdio_func variable. This is a layering violation and we can use the wilc_dev->dev pointer instead. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/linux_wlan_sdio.c | 2 +- drivers/staging/wilc1000/linux_wlan_sdio.h | 2 -- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 ++------- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index b1707147aa7d..08c3be8728b2 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1457,7 +1457,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type) { struct wireless_dev *wdev; - wdev = wilc_create_wiphy(ndev); + wdev = wilc_create_wiphy(ndev, dev); if (dev) SET_NETDEV_DEV(ndev, dev); diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index d2843b949a1b..874a859cad21 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -22,7 +22,7 @@ #define MAX_SPEED (6 * 1000000) /* Max 50M */ #endif -struct sdio_func *wilc_sdio_func; +static struct sdio_func *wilc_sdio_func; static unsigned int sdio_default_speed; #define SDIO_VENDOR_ID_WILC 0x0296 diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.h b/drivers/staging/wilc1000/linux_wlan_sdio.h index 3e1618526e78..df733c25e770 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.h +++ b/drivers/staging/wilc1000/linux_wlan_sdio.h @@ -1,7 +1,5 @@ #include -extern struct sdio_func *wilc_sdio_func; - int wilc_sdio_init(void); int wilc_sdio_cmd52(sdio_cmd52_t *cmd); int wilc_sdio_cmd53(sdio_cmd53_t *cmd); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 46c3f578a6fd..cc279c654e53 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -11,9 +11,6 @@ */ #include "wilc_wfi_cfgoperations.h" -#ifdef WILC_SDIO -#include "linux_wlan_sdio.h" -#endif #include "host_interface.h" #include @@ -3414,7 +3411,7 @@ _fail_: * @date 01 MAR 2012 * @version 1.0 */ -struct wireless_dev *wilc_create_wiphy(struct net_device *net) +struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *dev) { struct wilc_priv *priv; struct wireless_dev *wdev; @@ -3466,9 +3463,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net) wdev->wiphy->max_scan_ssids, wdev->wiphy->max_scan_ie_len, wdev->wiphy->signal_type, wdev->wiphy->interface_modes, wdev->iftype); - #ifdef WILC_SDIO - set_wiphy_dev(wdev->wiphy, &wilc_sdio_func->dev); - #endif + set_wiphy_dev(wdev->wiphy, dev); /*Register wiphy structure*/ s32Error = wiphy_register(wdev->wiphy); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 158d98c0eb87..ab53d9d59081 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -10,7 +10,7 @@ #define NM_WFI_CFGOPERATIONS #include "wilc_wfi_netdevice.h" -struct wireless_dev *wilc_create_wiphy(struct net_device *net); +struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *dev); void wilc_free_wiphy(struct net_device *net); int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed); int wilc_deinit_host_int(struct net_device *net);