Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6547032pxu; Thu, 24 Dec 2020 05:28:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOT2HmdyvWuQYsp+VGcj/Rbnw6G9cRFSnJ3QTOMllYl+5K0Do/VSFTB56S0duPj+3SUnlH X-Received: by 2002:a50:9b58:: with SMTP id a24mr28210868edj.22.1608816525936; Thu, 24 Dec 2020 05:28:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608816525; cv=none; d=google.com; s=arc-20160816; b=FML6Tdd0cr9mPPRKEjktlFfM7X8a7RLDQDwfb9nrMjezh/+AmsD37bpE62rLTNuAlG C9eW9ozEhOdI4pRoRRtrRm7lbj+fhhi55gW4IZ7k1t6kKcLRPPLVbhek4gbjOzfx9bk3 DN8BMiEeiZimFRc1NzexCLPukX+ciuy8xAo/KmLA7GDY9Ka+R1VU0lllnXkhcLpu1J4u dswnnSb2dsDwEvqY5jzAuGAHW4pf5V66MaxRyWrPj26zQF45N2Wr2+k5HM2DOPf2HMqM Io/Vxs/g/X6LtyFUtoH4Qdjyl1Fr2TiQGyIu4f4L9+q57ZIAAAM+NsPnyQAl6d2dxWfz WL4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RCJV8bF+eEvAZmQvIJWHBcQpKIfLJQtxBKRYai29iAQ=; b=g7jnPlpPtF97R3mGHhQhOTaqWjH0PpxiEOlcnYNhsG4Kc9FN26c/sZ1kfOPywfsdFc 1KMbq9YdblU8KJY/BFULpUBTZpqXfNdI5gcVgNA0VdXRa7vYj5oXIXMsJu8F9lLZEBtD YXg4sJ3q2ms/jhqmELHBWrmdr2GEvJJS4Jhi5aiv8dlfPnjI/NChMYWF8mM7cSWY/0je XMDGjtaF6mFqLYCnkMnp8KP0/nEK0b4fJjfMUXxR+kZDCHxomP77YQdA5ysh+6kfm8Sn 59vPA3w1+zJWlLWRqzVzCb+srTtTzcOVyIFBdCZpx8Cw/vxOkMCDj2Ua63u8vOJa6Ajw HDoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de26si15100065edb.570.2020.12.24.05.28.24; Thu, 24 Dec 2020 05:28:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729208AbgLXN0R (ORCPT + 99 others); Thu, 24 Dec 2020 08:26:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9647 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbgLXN0R (ORCPT ); Thu, 24 Dec 2020 08:26:17 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4D1rQn3h7jz15jCW; Thu, 24 Dec 2020 21:24:49 +0800 (CST) Received: from ubuntu.network (10.175.138.68) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 24 Dec 2020 21:25:25 +0800 From: Zheng Yongjun To: , , , , , , CC: Zheng Yongjun Subject: [PATCH v2 -next] video: backlight: use DEFINE_MUTEX() for mutex lock Date: Thu, 24 Dec 2020 21:26:01 +0800 Message-ID: <20201224132601.31791-1-zhengyongjun3@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.138.68] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun --- drivers/video/backlight/backlight.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 537fe1b376ad..d7a09c422547 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -64,7 +64,7 @@ */ static struct list_head backlight_dev_list; -static struct mutex backlight_dev_list_mutex; +static DEFINE_MUTEX(backlight_dev_list_mutex); static struct blocking_notifier_head backlight_notifier; static const char *const backlight_types[] = { @@ -757,7 +757,6 @@ static int __init backlight_class_init(void) backlight_class->dev_groups = bl_device_groups; backlight_class->pm = &backlight_class_dev_pm_ops; INIT_LIST_HEAD(&backlight_dev_list); - mutex_init(&backlight_dev_list_mutex); BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier); return 0; -- 2.22.0