Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp195356pxb; Wed, 18 Aug 2021 19:52:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQq+EAkiJvqkb+1KXqFhHr7onG3NoEBa1r4a0QzbgZ9u+k4Zqu8LbFRn8qkGpLRb8An9jO X-Received: by 2002:a5d:928c:: with SMTP id s12mr9609202iom.151.1629341558887; Wed, 18 Aug 2021 19:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629341558; cv=none; d=google.com; s=arc-20160816; b=DV9VY9Kh5zxXc6HDV+OBGY4UQUfn9vADFfYYe8IaTKf+likW/2UzduuJ0C6odAEUci GGC8+tkYY8t5HUAei0PKNAABltYD1MpvuijLzI9q89UFB9Jcb85jGSSKcZ3+QJC83drj 2DezRQ8EORska1+jSfbtxTl/jDShzxkjf1IH9nuJS1UjCom3pOwYY23b1qvQvzAsjhMq eGKCnAYjMaFnTO20UiuR17UbOX/3FHM4EgbC56N6gsAbApCV/DLFCpuMFllyG4egEHIy YCf4tinp1Wfera8qTWqHSoVbOkE9tbHLwN5SJ5ZuynqCHyFydq15OFHQxXZ9EO1ICRiE 7pBg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v5mjMakUsAY/Uh/ybHnL/303309Iy2FWIDQogSSAPJE=; b=jiEQsgLvochngR5SFE1ljhf2XUJjxnJ0Es3LB3YBqNRg+8OUJhc8ic/ldC65X+BsA8 62T9aZV+aHooGL3W9RRh0A86fYAfBt3oNAalCUpsqokBAdm76Cw8R8Z63/It0Jn3aZF+ l8xD1s7t7+m/0vlPybMUGDLummBWXE9IolHLPML/ulcDzkXvIltzgUFckrX67JdGgRRj gIa0b1VKkKWN6aKC786MPDzj5eyLB0ZwD60G+CBbsbsnX3cF25h3pKci26bjyDbHNhpy 421YkuMuOUC9VFACrEGa9c9oLY8O7oYddu3Ig1gzv0VkYIbIus/j8Pv+nM42BHDPiawd DzpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CKzXUP9e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h4si1708540jam.30.2021.08.18.19.52.28; Wed, 18 Aug 2021 19:52:38 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CKzXUP9e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236112AbhHSCwH (ORCPT + 99 others); Wed, 18 Aug 2021 22:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236007AbhHSCvs (ORCPT ); Wed, 18 Aug 2021 22:51:48 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 502AEC0617A8; Wed, 18 Aug 2021 19:51:12 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id y14-20020a0568302a0e00b0051acbdb2869so72454otu.2; Wed, 18 Aug 2021 19:51:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=v5mjMakUsAY/Uh/ybHnL/303309Iy2FWIDQogSSAPJE=; b=CKzXUP9e9H7OnWKRpvxpj9DZggpzSBm9fUyxcGKPKhuDDkyVLNst7w8zLS49jQfets u4tb6EORuqkPnRVK5gu50hISvyG/WzA8m+XDzGM71NHZyZApr07bCxToJ4B2v7H61CaW JVbse/inPDtaC7KHv2QX7IXFMKiLgrSokBBTyOh7Kf2MSuKOs70SpJbnKVjS8dpceYG7 gRct/vplsSHmwvF4Wb5ie0JrxoFxonxNt7GenSssHntTS9HFQycxXNnk8whkyninX4Y7 9u9BffctCML+de4ezoF37vX1MD6txzMwX7yFIukgxw/UKksw0AW/xkXRp7nizsWyuHTk w8Sw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=v5mjMakUsAY/Uh/ybHnL/303309Iy2FWIDQogSSAPJE=; b=MoB79Up6ehYIZytUJ5mEon/K7e1ZsowNT3LdrZrU3+yDTH9h3rv4VnrqnmlAop//UB ucVYq43Qo/Mxud1OgmUJUQ/KuvQVPj3+zJ93vhSW7bdcClh9nSsFdH9wIe1mpKis18ha l9GGRtxdaAOvfm3ePmS7HR23NktpRXI0pvHv/B1xueI1Yq3Tmf9PCw584fE2fEMOS4cD 4ki43em/xEQZMcSWtWJhKLORjIcaq9vabo60hnQsY/8PbSel5JewUdrCLr/zKTO7rnTQ cLnLt63U+juCgiAaBPK2XuI5mDoYNjiqofoPMtM3UHIQnVPNuCtLEgCJvFrp2JXw2AEn UOtw== X-Gm-Message-State: AOAM5331+5d+5dIYM2B2VIkfSBX0lUvNksC/ZWwkC8y6BOwEScxjkIkx YSbfXBPAGPaabx+23LmnBxOXP9Os/DZs14aa X-Received: by 2002:a05:6830:2b0d:: with SMTP id l13mr9768430otv.39.1629341471526; Wed, 18 Aug 2021 19:51:11 -0700 (PDT) Received: from ian.penurio.us ([47.184.51.90]) by smtp.gmail.com with ESMTPSA id w15sm156792oiw.19.2021.08.18.19.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 19:51:11 -0700 (PDT) From: Ian Pilcher To: linux-block@vger.kernel.org, linux-leds@vger.kernel.org Cc: axboe@kernel.dk, pavel@ucw.cz, kabel@kernel.org, linux-kernel@vger.kernel.org, kernelnewbies@kernelnewbies.org Subject: [RFC PATCH v3 10/18] block: Call LED trigger init/cleanup functions Date: Wed, 18 Aug 2021 21:50:45 -0500 Message-Id: <20210819025053.222710-11-arequipeno@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210819025053.222710-1-arequipeno@gmail.com> References: <20210819025053.222710-1-arequipeno@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call ledtrig_blkdev_disk_init() from __device_add_disk() to ensure that gendisk's ledtrig field is initialized Call ledtrig_blkdev_disk_cleanup() from del_gendisk() to clean up any references to the device from the block device LED trigger Signed-off-by: Ian Pilcher --- block/genhd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index e6d7bb709d62..091b954ddab3 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "blk.h" @@ -539,6 +540,7 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk, disk_add_events(disk); blk_integrity_add(disk); + ledtrig_blkdev_disk_init(disk); } void device_add_disk(struct device *parent, struct gendisk *disk, @@ -581,6 +583,7 @@ void del_gendisk(struct gendisk *disk) if (WARN_ON_ONCE(!disk->queue)) return; + ledtrig_blkdev_disk_cleanup(disk); blk_integrity_del(disk); disk_del_events(disk); -- 2.31.1