From patchwork Tue Feb 18 13:36:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3670431 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0D0AFBF13A for ; Tue, 18 Feb 2014 13:37:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EE3720160 for ; Tue, 18 Feb 2014 13:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15EDD20103 for ; Tue, 18 Feb 2014 13:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755211AbaBRNhK (ORCPT ); Tue, 18 Feb 2014 08:37:10 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:63830 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755063AbaBRNhJ (ORCPT ); Tue, 18 Feb 2014 08:37:09 -0500 Received: by mail-pd0-f177.google.com with SMTP id x10so16148235pdj.22 for ; Tue, 18 Feb 2014 05:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=APrNCwADPiZeYgCjw6nFBMYPUSFolvs3M+NgjeQQ9Ck=; b=R7c23X4p7fXgAkSExnmcFSyAAJnGCiBkRBUTC5HJ12oSMy7e3aPRI1vfyR4gIA53zI DaWQ2xyvV57HZTDe/MM70fouC2POkw6pNvTBJGuO8rhYG9u+9xWaJSucIfRr/UpG4x7D TVNrPavdc7rcLDl+FEqXA56OqMcwg2l2Jp5XvLerc7UvI+1A+hszKFxBTE4AN8mSbkKM hcQ5rAGNkCEv9J31bYqfQ1MUAWVuc0QuVXgUPVi3O+9R+Miz9qWBH9G54KscBmQGa7hf IwBRNLFBdd0oqzz9J66jdRcepcEpFI6KXnnAFlHNck2gGncqUUum8EBwWLGRSQOnq3v0 puqg== X-Received: by 10.66.155.133 with SMTP id vw5mr33339840pab.124.1392730627485; Tue, 18 Feb 2014 05:37:07 -0800 (PST) Received: from will.lan ([175.153.40.117]) by mx.google.com with ESMTPSA id vx10sm142544850pac.17.2014.02.18.05.37.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Feb 2014 05:37:07 -0800 (PST) From: "Zhao, Gang" To: "John W. Linville" Cc: Subject: [PATCH 5/7] zd1201: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} Date: Tue, 18 Feb 2014 21:36:01 +0800 Message-Id: <53f9c47a038d51d1f0447ddbd384da7692a78d68.1392728354.git.gamerh2o@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: References: In-Reply-To: References: 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.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more generic ieee80211_{channel_to_frequency, frequency_to_channel}. Function ieee80211_frequency_to_channel() will return 0 if frequency is not correctly provided, so no need to set channel to 0 explicitly. Include for the defination of IEEE80211_BAND_2GHZ. Because includes , so we can replace with . This change is a preparation for the removal of function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}. Signed-off-by: Zhao, Gang --- drivers/net/wireless/zd1201.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index d39c417..6f5c793 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -914,11 +914,8 @@ static int zd1201_set_freq(struct net_device *dev, if (freq->e == 0) channel = freq->m; - else { - channel = ieee80211_freq_to_dsss_chan(freq->m); - if (channel < 0) - channel = 0; - } + else + channel = ieee80211_frequency_to_channel(freq->m); err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel); if (err)