From: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 2/4] drm/amdgpu: Plus NULL function pointer check
Date: Mon, 12 Mar 2018 20:34:08 +0800 [thread overview]
Message-ID: <1520858050-7338-2-git-send-email-Rex.Zhu@amd.com> (raw)
In-Reply-To: <1520858050-7338-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Change-Id: Ifd6553646e7468bc935504075816074373e1d58d
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 56b2245..d60ecc5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1415,12 +1415,14 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
/* enable clockgating to save power */
- r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
+ if (adev->ip_blocks[i].version->funcs->set_clockgating_state) {
+ r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
AMD_CG_STATE_GATE);
- if (r) {
- DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (r) {
+ DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
}
}
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-03-12 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 12:34 [PATCH 1/4] drm/amd/pp: Move helper functions to smu_help.c Rex Zhu
[not found] ` <1520858050-7338-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-12 12:34 ` Rex Zhu [this message]
[not found] ` <1520858050-7338-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-12 12:54 ` [PATCH 2/4] drm/amdgpu: Plus NULL function pointer check Christian König
[not found] ` <71e3bf37-5289-422b-7b04-de2d4e60ce9c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-12 14:13 ` Zhu, Rex
2018-03-12 12:34 ` [PATCH 3/4] drm/amdgpu: Remove wrapper layer of amdgpu_powerplay Rex Zhu
[not found] ` <1520858050-7338-3-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-13 16:02 ` Alex Deucher
2018-03-12 12:34 ` [PATCH 4/4] drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c Rex Zhu
[not found] ` <1520858050-7338-4-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-03-13 15:55 ` Alex Deucher
2018-03-13 15:56 ` [PATCH 1/4] drm/amd/pp: Move helper functions to smu_help.c Alex Deucher
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=1520858050-7338-2-git-send-email-Rex.Zhu@amd.com \
--to=rex.zhu-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox