From patchwork Mon Jun 13 10:37:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Binoy Jayan X-Patchwork-Id: 69864 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1472573qgf; Mon, 13 Jun 2016 03:38:46 -0700 (PDT) X-Received: by 10.66.164.2 with SMTP id ym2mr21184621pab.100.1465814324523; Mon, 13 Jun 2016 03:38:44 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si17288593pan.105.2016.06.13.03.38.44; Mon, 13 Jun 2016 03:38:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422739AbcFMKib (ORCPT + 30 others); Mon, 13 Jun 2016 06:38:31 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33236 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422699AbcFMKi2 (ORCPT ); Mon, 13 Jun 2016 06:38:28 -0400 Received: by mail-pf0-f170.google.com with SMTP id y124so45216860pfy.0 for ; Mon, 13 Jun 2016 03:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=87+eWBofssZlU5fC/W3AwKa2TCvpHmOEBZc1KEOhjmI=; b=Oiil/OI4THD+KbDJjVSiejIZ1cBZiGq0GTn82Um+5s1IMFJEklD/OMEwTFIkJ1m++R 1xAy1+/3gczCMVe9Pw0pRYJBA31gdsY/nih0VsbZAi8YZnktOjakUzfd2toqFSbdfMGR Kp33FaPXRfJjL/Rxr0ge8/IOsKQ0HT7CHdlNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=87+eWBofssZlU5fC/W3AwKa2TCvpHmOEBZc1KEOhjmI=; b=XRtZqi0/IShIAM4bcllpIZ6XGLGm1niW79rsVb+27934LVNw3kz4nEgKaQpdUufxBB VQCNNW3Sc8SoF8oRjOWrHChJxHGLFbqJuq1fSZynNuzTCygw9FNRJUHvLHTsbVI16ZE2 1yRi1smy6RrGQq4v7YIMoulEiKcgxd5Tzw7h2YxGUH4QVGcjClnxPfAjdlOVYjYDwARq kShWU5AYlZHm6+qJsYMyoupZPoYCNh1oMdCPuq01gBi387OWRsqMlGa5vh4vwZfD8A8w V1a0ON/Wr+NuSbbRJVlUNsRDYrUqPkc6qarSkOo/Uyr6fmzNQTtLRLUTyZwSYaEWEGJR qm5g== X-Gm-Message-State: ALyK8tJ0Yyh76TNIL4kGrLBh39s6XTIvP0dft/FAnhQ2ayd/pMQLT/kObxgaJfhmIDYASDya X-Received: by 10.98.5.196 with SMTP id 187mr20981983pff.133.1465814307278; Mon, 13 Jun 2016 03:38:27 -0700 (PDT) Received: from localhost.localdomain ([116.68.103.40]) by smtp.gmail.com with ESMTPSA id h6sm24194895pac.46.2016.06.13.03.38.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Jun 2016 03:38:26 -0700 (PDT) From: Binoy Jayan To: Greg Kroah-Hartman Cc: Arnd Bergmann , Johnny Kim , Austin Shin , Chris Park , Tony Cho , Glen Lee , Leo Kim , devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Binoy Jayan Subject: [PATCH 5/7] staging: wilc1000: Replace semaphore close_exit_sync with completion Date: Mon, 13 Jun 2016 16:07:37 +0530 Message-Id: <1465814259-3009-6-git-send-email-binoy.jayan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465814259-3009-1-git-send-email-binoy.jayan@linaro.org> References: <1465814259-3009-1-git-send-email-binoy.jayan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The semaphore 'close_exit_sync' is used as completion, so convert it to a struct completion type. Signed-off-by: Binoy Jayan --- drivers/staging/wilc1000/linux_wlan.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 39fe350..ac537c7 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -31,7 +31,7 @@ static struct notifier_block g_dev_notifier = { .notifier_call = dev_state_ev_handler }; -static struct semaphore close_exit_sync; +static struct completion close_exit_sync; static int wlan_deinit_locks(struct net_device *dev); static void wlan_deinitialize_threads(struct net_device *dev); @@ -1088,7 +1088,7 @@ int wilc_mac_close(struct net_device *ndev) WILC_WFI_deinit_mon_interface(); } - up(&close_exit_sync); + complete(&close_exit_sync); vif->mac_opened = 0; return 0; @@ -1232,7 +1232,8 @@ void wilc_netdev_cleanup(struct wilc *wilc) } if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) { - wilc_lock_timeout(wilc, &close_exit_sync, 5 * 1000); + wait_for_completion_timeout(&close_exit_sync, + msecs_to_jiffies(5000)); for (i = 0; i < NUM_CONCURRENT_IFC; i++) if (wilc->vif[i]->ndev) @@ -1258,7 +1259,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, struct net_device *ndev; struct wilc *wl; - sema_init(&close_exit_sync, 0); + init_completion(&close_exit_sync); wl = kzalloc(sizeof(*wl), GFP_KERNEL); if (!wl)