From: Boris Brezillon <boris.brezillon@collabora.com>
To: Chia-I Wu <olvaffe@gmail.com>
Cc: Steven Price <steven.price@arm.com>,
Liviu Dudau <liviu.dudau@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] panthor: set owner field for driver fops
Date: Mon, 23 Jun 2025 08:16:51 +0200 [thread overview]
Message-ID: <20250623081651.26fd2cd5@fedora> (raw)
In-Reply-To: <20250620235053.164614-2-olvaffe@gmail.com>
On Fri, 20 Jun 2025 16:50:50 -0700
Chia-I Wu <olvaffe@gmail.com> wrote:
> It allows us to get rid of manual try_module_get / module_put.
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> drivers/gpu/drm/panthor/panthor_drv.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 1116f2d2826ee..775a66c394544 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -1400,14 +1400,9 @@ panthor_open(struct drm_device *ddev, struct drm_file *file)
> struct panthor_file *pfile;
> int ret;
>
> - if (!try_module_get(THIS_MODULE))
> - return -EINVAL;
> -
> pfile = kzalloc(sizeof(*pfile), GFP_KERNEL);
> - if (!pfile) {
> - ret = -ENOMEM;
> - goto err_put_mod;
> - }
> + if (!pfile)
> + return -ENOMEM;
>
> pfile->ptdev = ptdev;
> pfile->user_mmio.offset = DRM_PANTHOR_USER_MMIO_OFFSET;
> @@ -1439,9 +1434,6 @@ panthor_open(struct drm_device *ddev, struct drm_file *file)
>
> err_free_file:
> kfree(pfile);
> -
> -err_put_mod:
> - module_put(THIS_MODULE);
> return ret;
> }
>
> @@ -1454,7 +1446,6 @@ panthor_postclose(struct drm_device *ddev, struct drm_file *file)
> panthor_vm_pool_destroy(pfile);
>
> kfree(pfile);
> - module_put(THIS_MODULE);
> }
>
> static const struct drm_ioctl_desc panthor_drm_driver_ioctls[] = {
> @@ -1555,6 +1546,7 @@ static void panthor_show_fdinfo(struct drm_printer *p, struct drm_file *file)
> }
>
> static const struct file_operations panthor_drm_driver_fops = {
> + .owner = THIS_MODULE,
> .open = drm_open,
> .release = drm_release,
> .unlocked_ioctl = drm_ioctl,
next prev parent reply other threads:[~2025-06-23 6:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 23:50 [PATCH 0/4] panthor: print task pid and comm on gpu errors Chia-I Wu
2025-06-20 23:50 ` [PATCH 1/4] panthor: set owner field for driver fops Chia-I Wu
2025-06-23 6:16 ` Boris Brezillon [this message]
2025-06-23 8:42 ` Steven Price
2025-06-20 23:50 ` [PATCH 2/4] panthor: save panthor_file in panthor_group Chia-I Wu
2025-06-23 6:21 ` Boris Brezillon
2025-06-23 9:07 ` Liviu Dudau
2025-07-13 3:12 ` Chia-I Wu
2025-06-20 23:50 ` [PATCH 3/4] panthor: save task pid and comm in panthor_file Chia-I Wu
2025-06-20 23:50 ` [PATCH 4/4] panthor: dump task pid and comm on gpu errors Chia-I Wu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250623081651.26fd2cd5@fedora \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.