Message ID | 20240123221227.868341-3-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-36123-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp639450dyi; Tue, 23 Jan 2024 14:27:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5h9T3jMGj68jOkT3ruWOg1rQmILdYFzM3bwxTIF8tgP0Xsah0sc0J/8mp/mgn2w4s6R4Y X-Received: by 2002:a05:6870:d18f:b0:205:c4d8:155a with SMTP id a15-20020a056870d18f00b00205c4d8155amr2334258oac.62.1706048827842; Tue, 23 Jan 2024 14:27:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706048827; cv=pass; d=google.com; s=arc-20160816; b=cs0PieW3ihOs1AoEvypP8WxMIyXdySWwRTt6Xm4xJdcpdriQKLkyfo50FuIH/ZFdFS 1OsyDOEvMZWCq5YERfJwYgZ3uTNJ+/pcqmFMt4d+XeyhT6eAQS5v1v44cEkBPY8n2uKx +J6hplajr6NH4x/b4UoQPS6zQaLCj9q2qM2TrBPAQcAHwd6W0QrZv2TXtg27PjH8zGAN SezsABJ1QX9SnjYp5ymKKpgCgSJPtOYeBaxh8hlNTxpzgSfMLm26xEAVA3EcIWdIT3ze Ps6bHbwhvdhvBPvvbTypBsyKJoaEQGeVtlFhKFuWaYJFyP7isdGY8MAVhmGpCVqj8/Tm akJA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36123-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q18-20020a656852000000b005d3a25c02f3si1548692pgt.769.2024.01.23.14.27.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 14:27:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36123-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36123-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4E1F8B23A26 for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 22:13:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B96E3537E9; Tue, 23 Jan 2024 22:12:45 +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 <afd@ti.com> To: Gerd Hoffmann <kraxel@redhat.com>, Sumit Semwal <sumit.semwal@linaro.org>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Paul Cercueil <paul@crapouillou.net> CC: <dri-devel@lists.freedesktop.org>, <linux-media@vger.kernel.org>, <linaro-mm-sig@lists.linaro.org>, <linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788921855300050678 X-GMAIL-MSGID: 1788921855300050678 |
Series |
[1/3] udmabuf: Keep track current device mappings
|
|
Commit Message
Andrew Davis
Jan. 23, 2024, 10:12 p.m. UTC
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 <afd@ti.com>
---
drivers/dma-buf/udmabuf.c | 30 +-----------------------------
1 file changed, 1 insertion(+), 29 deletions(-)
Comments
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com> > > 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 <afd@ti.com> > --- > 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 <kraxel@redhat.com>"); > -- > 2.39.2
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 <kraxel@redhat.com>");