From patchwork Tue May 22 21:29:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= X-Patchwork-Id: 10419635 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C754560545 for ; Tue, 22 May 2018 21:29:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B81E128DEC for ; Tue, 22 May 2018 21:29:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC67228DEE; Tue, 22 May 2018 21:29:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EB5F28DEC for ; Tue, 22 May 2018 21:29:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753075AbeEVV3h (ORCPT ); Tue, 22 May 2018 17:29:37 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:39374 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbeEVV3g (ORCPT ); Tue, 22 May 2018 17:29:36 -0400 Received: by mail-pl0-f67.google.com with SMTP id c19-v6so11659507pls.6; Tue, 22 May 2018 14:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jn6jBkRxfz7LVQrVIz1GO6GAxVzc+13CeFQ7LO1BYxU=; b=Hds2yumrdiWLQN/Sk8kZj6kJJNBcQAc+ELIYPxGXEY7K9WAokjl/9LzMVIZcg38U2c qRWs0mszNWAuO6qMe5QUg4zn89+o8abPLd07+l/k5lQLHS43949aB2LsJDU1SBuiNy8V 3R5ZMCzDXEFxoCSDW4wK4n4IMtYSO44vz/H2qI0gu3cdKp6Snp7DeBBGn64dUfzVRDPZ hMd3AzvnRRVyFvGPfUG53H12We1YzJ3bFvIOCH0XtK75BpYysS6RaCsqRTXgIlBQ1RFU P9Imvp+PTBj/3BKMyFlek/eZUJuTljz+XvfbL5ynrUzcF/UWkB29lQqxKjtTa5wDiZdO 9FUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jn6jBkRxfz7LVQrVIz1GO6GAxVzc+13CeFQ7LO1BYxU=; b=Wau+1fcRsOD6Bc5G+iml2tHQ+Tlzm1F60G6OalzCAI17+sKVb8lrBhzrsO1p7v4E6q SErFIvC9scH75RpCNGXV2o6NvjLteZ/v/8ppAYxYy8YSnCLGfvc7Xl9xykpZ4uol3Xqc jS1csJCQHatC7RODzr+zVxjAHP80X4TfQqwBuyRD+x6+2McdOBhslUTjIMtARWQzyn52 0pfJLpLMGZqCcNJbMr9zUjsoK9NO3m28cD/4GRG3WNqscdRW9H4au0ykjkSVAPqQX0T6 cwbj/j85PvZDfuoIyIB2V0Af8lqKvADbJYYQEfMHQcDTVDJiSU6KvEqFkM+u/SSKolAQ WHhA== X-Gm-Message-State: ALKqPwcNYjlLFMv3fhUZvG2Jf3fGAckjfPkps1/kfaKWlXy/HQGkKvmF QBcIXsZMR30CjciKeTMKfEQ= X-Google-Smtp-Source: AB8JxZolr+KN+euYzY5cZ0IZgYX6udzlIt3FqMQYS8DIdLIE1r8qB1Qn2oJyCrUeRo81+DkrrmkBQw== X-Received: by 2002:a17:902:301:: with SMTP id 1-v6mr152079pld.328.1527024575548; Tue, 22 May 2018 14:29:35 -0700 (PDT) Received: from kiddo.hsd1.wa.comcast.net (c-73-169-152-248.hsd1.wa.comcast.net. [73.169.152.248]) by smtp.gmail.com with ESMTPSA id b81-v6sm31177172pfj.56.2018.05.22.14.29.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 14:29:34 -0700 (PDT) From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=" X-Google-Original-From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= To: Johannes Berg , "David S. Miller" Cc: linux@endlessm.com, =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= , =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rfkill: Rename rfkill_any_led_trigger* functions Date: Tue, 22 May 2018 14:29:31 -0700 Message-Id: <20180522212932.5357-1-jprvita@endlessm.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rename these functions to rfkill_global_led_trigger*, as they are going to be extended to handle another global rfkill led trigger. This commit does not change any functionality. Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 59d0eb960275..6d64d14f4b0a 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -178,9 +178,9 @@ static void rfkill_led_trigger_unregister(struct rfkill *rfkill) } static struct led_trigger rfkill_any_led_trigger; -static struct work_struct rfkill_any_work; +static struct work_struct rfkill_global_led_trigger_work; -static void rfkill_any_led_trigger_worker(struct work_struct *work) +static void rfkill_global_led_trigger_worker(struct work_struct *work) { enum led_brightness brightness = LED_OFF; struct rfkill *rfkill; @@ -197,28 +197,29 @@ static void rfkill_any_led_trigger_worker(struct work_struct *work) led_trigger_event(&rfkill_any_led_trigger, brightness); } -static void rfkill_any_led_trigger_event(void) +static void rfkill_global_led_trigger_event(void) { - schedule_work(&rfkill_any_work); + schedule_work(&rfkill_global_led_trigger_work); } -static void rfkill_any_led_trigger_activate(struct led_classdev *led_cdev) +static void rfkill_global_led_trigger_activate(struct led_classdev *led_cdev) { - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); } -static int rfkill_any_led_trigger_register(void) +static int rfkill_global_led_trigger_register(void) { - INIT_WORK(&rfkill_any_work, rfkill_any_led_trigger_worker); + INIT_WORK(&rfkill_global_led_trigger_work, + rfkill_global_led_trigger_worker); rfkill_any_led_trigger.name = "rfkill-any"; - rfkill_any_led_trigger.activate = rfkill_any_led_trigger_activate; + rfkill_any_led_trigger.activate = rfkill_global_led_trigger_activate; return led_trigger_register(&rfkill_any_led_trigger); } -static void rfkill_any_led_trigger_unregister(void) +static void rfkill_global_led_trigger_unregister(void) { led_trigger_unregister(&rfkill_any_led_trigger); - cancel_work_sync(&rfkill_any_work); + cancel_work_sync(&rfkill_global_led_trigger_work); } #else static void rfkill_led_trigger_event(struct rfkill *rfkill) @@ -234,16 +235,16 @@ static inline void rfkill_led_trigger_unregister(struct rfkill *rfkill) { } -static void rfkill_any_led_trigger_event(void) +static void rfkill_global_led_trigger_event(void) { } -static int rfkill_any_led_trigger_register(void) +static int rfkill_global_led_trigger_register(void) { return 0; } -static void rfkill_any_led_trigger_unregister(void) +static void rfkill_global_led_trigger_unregister(void) { } #endif /* CONFIG_RFKILL_LEDS */ @@ -354,7 +355,7 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) spin_unlock_irqrestore(&rfkill->lock, flags); rfkill_led_trigger_event(rfkill); - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); if (prev != curr) rfkill_event(rfkill); @@ -535,7 +536,7 @@ bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) spin_unlock_irqrestore(&rfkill->lock, flags); rfkill_led_trigger_event(rfkill); - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); if (rfkill->registered && prev != blocked) schedule_work(&rfkill->uevent_work); @@ -579,7 +580,7 @@ bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) schedule_work(&rfkill->uevent_work); rfkill_led_trigger_event(rfkill); - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); return blocked; } @@ -629,7 +630,7 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) schedule_work(&rfkill->uevent_work); rfkill_led_trigger_event(rfkill); - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); } } EXPORT_SYMBOL(rfkill_set_states); @@ -1046,7 +1047,7 @@ int __must_check rfkill_register(struct rfkill *rfkill) #endif } - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); rfkill_send_events(rfkill, RFKILL_OP_ADD); mutex_unlock(&rfkill_global_mutex); @@ -1079,7 +1080,7 @@ void rfkill_unregister(struct rfkill *rfkill) mutex_lock(&rfkill_global_mutex); rfkill_send_events(rfkill, RFKILL_OP_DEL); list_del_init(&rfkill->node); - rfkill_any_led_trigger_event(); + rfkill_global_led_trigger_event(); mutex_unlock(&rfkill_global_mutex); rfkill_led_trigger_unregister(rfkill); @@ -1332,7 +1333,7 @@ static int __init rfkill_init(void) if (error) goto error_misc; - error = rfkill_any_led_trigger_register(); + error = rfkill_global_led_trigger_register(); if (error) goto error_led_trigger; @@ -1346,7 +1347,7 @@ static int __init rfkill_init(void) #ifdef CONFIG_RFKILL_INPUT error_input: - rfkill_any_led_trigger_unregister(); + rfkill_global_led_trigger_unregister(); #endif error_led_trigger: misc_deregister(&rfkill_miscdev); @@ -1362,7 +1363,7 @@ static void __exit rfkill_exit(void) #ifdef CONFIG_RFKILL_INPUT rfkill_handler_exit(); #endif - rfkill_any_led_trigger_unregister(); + rfkill_global_led_trigger_unregister(); misc_deregister(&rfkill_miscdev); class_unregister(&rfkill_class); }