Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp757260rdb; Tue, 23 Jan 2024 14:13:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IENl1y3SbEiHu9B9cTjaAFGt6Dn6OIvoRuwsslq+WK9pKWK9vLzNgY0d/etRPUDg/R8v2OF X-Received: by 2002:ae9:e41a:0:b0:783:7775:b395 with SMTP id q26-20020ae9e41a000000b007837775b395mr7092795qkc.74.1706048000786; Tue, 23 Jan 2024 14:13:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706048000; cv=pass; d=google.com; s=arc-20160816; b=JTuSmrBZBpAOpIKTqhO5c5D8GIoO8FOPrwQjEaLyocDfZvse9HSqGyqm4mgpFpjJnA npfmjXOJmYtNgR/84xaIQfleBA4riUFbIhmJnviihKOQxJ1CIvBJQFTUDtG43AEWVhJi g+7EPn0Rcx9WdcuAsTdNw52qfeiyRCZUpFznXlGe4Cj4ulnCxnryTxJO1C/qfU70ihBw gFTCJ4OaD8uXU0MpE04qsmV+6RwyBjnDWyHYysfE5cTEWw3inXL4YB3zcOCHrg57dg7V /2jrEieHfx1JiRTPTBcE/O1QDA/Vm67nfdk4FB/NK0nvlbK+a5Yc6+VfezKHHoWCXkOr 1+bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sknuwzcV0wPaLHOK1zr7w6OmYOJwUVklzNLaSRJo1ZQ=; fh=JtJoRmEMNM7h+1I1BByQR+6uMM5KgzVUsDnK41zecMo=; b=li1WZJhRkM6+9f4d56rrHWNpyNjgRr8cM60cQZb79XPjbgA6wjqcvKcQWTkmIqfJuZ YcvwbS9MBrBLJ9dooMiUUVBp3zKKXJYm2swaWmgipnTyedjK6piqxLUwLOAL/vGpnkkA 7tQvT2uJjFGe52uDODyoU/x8d0YycE9sTCG16PmK/UZm+YIqTNrdRMDk6ngwOUrib9pm 62XDXwjI2Mhvlle8LtzUI1PESlbx1WGGUibEYR2+ZME6qfeDreO7MSFB7VZQ/sAwIIgn dKAwD3xBz0bvMcDKJA4CpCo04+I0AlwrOWPzBEBLJOiElTpC3UMCAfN4EDCBoRlrBYeC yBWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=p2IuT1J4; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-36123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a2-20020a05620a124200b00781e319f28esi8814597qkl.160.2024.01.23.14.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 14:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=p2IuT1J4; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-36123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8A4C81C22A6B for ; Tue, 23 Jan 2024 22:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E01D54F893; Tue, 23 Jan 2024 22:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="p2IuT1J4" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FB081A27C; Tue, 23 Jan 2024 22:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706047963; cv=none; b=oEREVZ3rtazffxgZ3VQMl0zflGVRaP3ofbHmzAsQmn9YtvedkCMPI5Z/CXhLT4mqzjK5z+IZWBgzTROJoqAxzQ5FRftyDxYu8vW56i/ACDwLx83XdrAdCL3BruEGtelzGIhlcE55wy/8GQ6MbmIuY3TNT+TvTesXGnfo68Eqs6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706047963; c=relaxed/simple; bh=CN3luUJCGKbrlvtvv2WxMm/DQFJmECihVCV8vA4TB78=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BzIL0OcFJJoX0ozEenh5hogM4v2O1e4lIx7ZkWrza4OfOLc0TYmwtIhCPtqN8p83u2bYI6/0xRCINNJS3/lMmvQ6X3/Ru8l09pNpRDHy+r+h+nsVetYGucIXVFJETn/RCD/V77epaiV2PEriTYCM5PiBdgPayJWqb3dScqozofA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=p2IuT1J4; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 40NMCUrm016652; Tue, 23 Jan 2024 16:12:30 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706047950; bh=sknuwzcV0wPaLHOK1zr7w6OmYOJwUVklzNLaSRJo1ZQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=p2IuT1J44N91rtMKoKXS2hMU8xPdWjDirWcLgVWfPPoBCLE8OfzpWJecTPL6kleDL fmfJ7ZfEyGcsBR7f8SIa5yd+Gn05Nj76Ujr9VdRG4CAwCCDaVKM9I5COFWjVx0InjB WK5h3efgJwLsSrz8usrwjOjK24LYwrnkovFdtkpA= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 40NMCUcx077867 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jan 2024 16:12:30 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 23 Jan 2024 16:12:30 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 23 Jan 2024 16:12:29 -0600 Received: from lelvsmtp6.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 40NMCSuU068795; Tue, 23 Jan 2024 16:12:29 -0600 From: Andrew Davis To: Gerd Hoffmann , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Paul Cercueil CC: , , , , Andrew Davis Subject: [PATCH 3/3] udmabuf: Use module_misc_device() to register this device Date: Tue, 23 Jan 2024 16:12:27 -0600 Message-ID: <20240123221227.868341-3-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240123221227.868341-1-afd@ti.com> References: <20240123221227.868341-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Now that we do not need to call dma_coerce_mask_and_coherent() on our miscdevice device, use the module_misc_device() helper for registering and module init/exit. Signed-off-by: Andrew Davis --- drivers/dma-buf/udmabuf.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index ab6764322523c..3028ac3fd9f6a 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -392,34 +392,6 @@ static struct miscdevice udmabuf_misc = { .name = "udmabuf", .fops = &udmabuf_fops, }; - -static int __init udmabuf_dev_init(void) -{ - int ret; - - ret = misc_register(&udmabuf_misc); - if (ret < 0) { - pr_err("Could not initialize udmabuf device\n"); - return ret; - } - - ret = dma_coerce_mask_and_coherent(udmabuf_misc.this_device, - DMA_BIT_MASK(64)); - if (ret < 0) { - pr_err("Could not setup DMA mask for udmabuf device\n"); - misc_deregister(&udmabuf_misc); - return ret; - } - - return 0; -} - -static void __exit udmabuf_dev_exit(void) -{ - misc_deregister(&udmabuf_misc); -} - -module_init(udmabuf_dev_init) -module_exit(udmabuf_dev_exit) +module_misc_device(udmabuf_misc); MODULE_AUTHOR("Gerd Hoffmann "); -- 2.39.2