* [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
@ 2017-02-06 12:56 Ran Algawi
2017-02-06 13:02 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Ran Algawi @ 2017-02-06 12:56 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-rpi-kernel, linux-arm-kernel, linux-kernel
linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Bcc:
Subject: [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
Reply-To:
Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
Description: fixed errors and warnings in file at:
/drivers/staging/bcm2835-audio/bcm
mostly, i have changed syntax, like using null isntead of ! or
intialiazing stastics wil NULL.
fixed erros in drivers/staging/bcm2835-audio/bcm2835.c
---
drivers/staging/bcm2835-audio/bcm2835.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/bcm2835-audio/bcm2835.c b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74d..2e2c91d 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
* to debug if we run into issues
*/
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
static int snd_bcm2835_free(struct bcm2835_chip *chip)
{
@@ -49,8 +49,7 @@ static int snd_bcm2835_dev_free(struct snd_device *device)
* (see "Management of Cards and Components")
*/
static int snd_bcm2835_create(struct snd_card *card,
- struct platform_device *pdev,
- struct bcm2835_chip ** rchip)
+struct platform_device *pdev, struct bcm2835_chip **rchip);
{
struct bcm2835_chip *chip;
int err;
@@ -61,7 +60,7 @@ static int snd_bcm2835_create(struct snd_card *card,
*rchip = NULL;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (chip == NULL)
+ if (!chip)
return -ENOMEM;
chip->card = card;
@@ -163,7 +162,7 @@ static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
drv_data = platform_get_drvdata(pdev);
- if (drv_data == (void *) g_card) {
+ if (drv_data == (void *)g_card) {
/* This is the card device */
snd_card_free((struct snd_card *)drv_data);
g_card = NULL;
@@ -171,18 +170,18 @@ static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
} else {
idx = (int)(long)drv_data;
if (g_card) {
- BUG_ON(!g_chip);
+ WARN_ON(!g_chip);
/* We pass chip device numbers in audio ipc devices
* other than the one we registered our card with
*/
idx = (int)(long)drv_data;
- BUG_ON(!idx || idx > MAX_SUBSTREAMS);
+ WARN_ON(!idx || idx > MAX_SUBSTREAMS);
g_chip->avail_substreams &= ~(1 << idx);
/* There should be atleast one substream registered
* after we are done here, as it wil be removed when
* the *remove* is called for the card device
*/
- BUG_ON(!g_chip->avail_substreams);
+ WARN_ON(!g_chip->avail_substreams);
}
}
@@ -219,8 +218,7 @@ static struct platform_driver bcm2835_alsa0_driver = {
.suspend = snd_bcm2835_alsa_suspend,
.resume = snd_bcm2835_alsa_resume,
#endif
- .driver =
- {
+ .driver = {
.name = "bcm2835_AUD0",
.owner = THIS_MODULE,
.of_match_table = snd_bcm2835_of_match_table,
@@ -230,7 +228,9 @@ static struct platform_driver bcm2835_alsa0_driver = {
static int bcm2835_alsa_device_init(void)
{
int err;
+
err = platform_driver_register(&bcm2835_alsa0_driver);
+
if (err) {
pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
return err;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
2017-02-06 12:56 [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com> Ran Algawi
@ 2017-02-06 13:02 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2017-02-06 13:02 UTC (permalink / raw)
To: Ran Algawi; +Cc: linux-rpi-kernel, linux-arm-kernel, linux-kernel
On Mon, Feb 06, 2017 at 02:56:23PM +0200, Ran Algawi wrote:
> linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
> Bcc:
> Subject: [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
> Reply-To:
> Signed-off-by: Ran Algawi <ran.algawi@gmail.com>
> Description: fixed errors and warnings in file at:
> /drivers/staging/bcm2835-audio/bcm
> mostly, i have changed syntax, like using null isntead of ! or
> intialiazing stastics wil NULL.
>
> fixed erros in drivers/staging/bcm2835-audio/bcm2835.c
> ---
> drivers/staging/bcm2835-audio/bcm2835.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
Something went really wrong there, don't you agree?
:(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-06 13:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-06 12:56 [PATCH] Signed-off-by: Ran Algawi <ran.algawi@gmail.com> Ran Algawi
2017-02-06 13:02 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox