alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Goehrs <l.goehrs@pengutronix.de>
To: u.kleine-koenig@pengutronix.de, geoff@infradead.org,
	perex@perex.cz, tiwai@suse.com, mpe@ellerman.id.au
Cc: alsa-devel@alsa-project.org, benh@kernel.crashing.org,
	paulus@samba.org, kernel@pengutronix.de,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Leonard Goehrs <l.goehrs@pengutronix.de>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] ALSA: ppc: remove redundant checks in PS3 driver probe
Date: Fri, 27 Nov 2020 16:22:59 +0100	[thread overview]
Message-ID: <20201127152259.1470079-1-l.goehrs@pengutronix.de> (raw)
In-Reply-To: <20201127094547.4zcyeycfrriitkqx@pengutronix.de>

The check for the FW_FEATURE_PS3_LV1 firmware feature is already performed
in ps3_system_bus_init() before registering the driver. So if the probe
function is actually used, this feature is already known to be available.

The check for the match id is also superfluous; the condition is always
true because the bus' match function (ps3_system_bus_match()) only
considers this driver for devices having:
dev->match_id == snd_ps3_bus_driver_info.match_id.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Leonard Goehrs <l.goehrs@pengutronix.de>
---
 sound/ppc/snd_ps3.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index 58bb49fff184..b6e4aa3df870 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -896,11 +896,6 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
 	u64 lpar_addr, lpar_size;
 	static u64 dummy_mask;
 
-	if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)))
-		return -ENODEV;
-	if (WARN_ON(dev->match_id != PS3_MATCH_ID_SOUND))
-		return -ENODEV;
-
 	the_card.ps3_dev = dev;
 
 	ret = ps3_open_hv_device(dev);
-- 
2.20.1


  reply	other threads:[~2020-11-30 16:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 16:59 [PATCH 1/2] ALSA: ppc: drop if block with always false condition Uwe Kleine-König
2020-11-26 16:59 ` [PATCH 2/2] powerpc/ps3: make system bus's remove and shutdown callbacks return void Uwe Kleine-König
2020-11-27  8:40   ` Geert Uytterhoeven
2020-11-27 19:39   ` Geoff Levand
2020-11-28  8:48   ` Takashi Iwai
2020-11-29 17:31     ` Uwe Kleine-König
2020-12-02 12:14       ` Michael Ellerman
2020-12-02 12:22         ` Takashi Iwai
2020-11-27  8:35 ` [PATCH 1/2] ALSA: ppc: drop if block with always false condition Geert Uytterhoeven
2020-11-27  9:45   ` Uwe Kleine-König
2020-11-27 15:22     ` Leonard Goehrs [this message]
2020-11-27 17:34       ` [PATCH] ALSA: ppc: remove redundant checks in PS3 driver probe Uwe Kleine-König
2020-11-27 19:39       ` Geoff Levand
2020-11-28  8:49       ` Takashi Iwai
2020-11-27 19:37 ` [PATCH 1/2] ALSA: ppc: drop if block with always false condition Geoff Levand
2020-11-28  8:48 ` Takashi Iwai

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=20201127152259.1470079-1-l.goehrs@pengutronix.de \
    --to=l.goehrs@pengutronix.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=benh@kernel.crashing.org \
    --cc=geert@linux-m68k.org \
    --cc=geoff@infradead.org \
    --cc=kernel@pengutronix.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=u.kleine-koenig@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).