All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 resend 5/5] drm/i915/uc: Move fw path check to fetch_uc_fw()
Date: Thu, 30 Mar 2017 11:21:15 +0000	[thread overview]
Message-ID: <20170330112115.120240-6-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20170330112115.120240-1-michal.wajdeczko@intel.com>

There is no reason to separately check for valid fw path before
we try to fetch it. Let the fetch function take care of this.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 4ab24a1..4dfde2c 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -112,6 +112,9 @@ static void fetch_uc_fw(struct drm_i915_private *dev_priv,
 	size_t size;
 	int err;
 
+	if (!uc_fw->path)
+		return;
+
 	uc_fw->fetch_status = INTEL_UC_FIRMWARE_PENDING;
 
 	DRM_DEBUG_DRIVER("before requesting firmware: uC fw fetch status %s\n",
@@ -239,11 +242,8 @@ static void fetch_uc_fw(struct drm_i915_private *dev_priv,
 
 void intel_uc_init_fw(struct drm_i915_private *dev_priv)
 {
-	if (dev_priv->huc.fw.path)
-		fetch_uc_fw(dev_priv, &dev_priv->huc.fw);
-
-	if (dev_priv->guc.fw.path)
-		fetch_uc_fw(dev_priv, &dev_priv->guc.fw);
+	fetch_uc_fw(dev_priv, &dev_priv->huc.fw);
+	fetch_uc_fw(dev_priv, &dev_priv->guc.fw);
 }
 
 void intel_uc_fini_fw(struct drm_i915_private *dev_priv)
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-03-30 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 11:21 [PATCH v2 resend 0/5] drm/i915/uc: Misc cleanups Michal Wajdeczko
2017-03-30 11:21 ` [PATCH v2 resend 1/5] drm/i915/uc: Move intel_uc_fw_status_repr() to intel_uc.h Michal Wajdeczko
2017-03-30 11:21 ` [PATCH v2 resend 2/5] drm/i915/uc: Add intel_uc_fw_type_repr() Michal Wajdeczko
2017-03-30 11:27   ` Chris Wilson
2017-03-30 11:35     ` Michal Wajdeczko
2017-03-30 11:21 ` [PATCH v2 resend 3/5] drm/i915/uc: Add intel_uc_fw_fini() Michal Wajdeczko
2017-03-30 11:21 ` [PATCH v2 resend 4/5] drm/i915/huc: Remove unused intel_huc_fini() Michal Wajdeczko
2017-03-30 11:21 ` Michal Wajdeczko [this message]
2017-03-30 13:31 ` ✓ Fi.CI.BAT: success for drm/i915/uc: Misc cleanups Patchwork
2017-03-31  7:41   ` Joonas Lahtinen

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=20170330112115.120240-6-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-gfx@lists.freedesktop.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 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.