[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191130075415.5d7ac0b1@kernel.org>
Date: Sat, 30 Nov 2019 07:54:15 +0100
From: Mauro Carvalho Chehab <mchehab@...nel.org>
To: "Daniel W. S. Almeida" <dwlsalmeida@...il.com>
Cc: gregkh@...uxfoundation.org, rfontana@...hat.com,
kstewart@...uxfoundation.org, tglx@...utronix.de,
skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: dvb_dummy_fe: Add error messages in case of
attach failure
Em Wed, 6 Nov 2019 22:37:45 -0300
"Daniel W. S. Almeida" <dwlsalmeida@...il.com> escreveu:
> From: "Daniel W. S. Almeida" <dwlsalmeida@...il.com>
>
> Complain if the attach functions fail, for any reason. This is helpful
> when debugging.
>
> Suggested-by: Shuah Khan <skhan@...uxfoundation.org>
> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@...il.com>
Looks OK to me.
> ---
> drivers/media/dvb-frontends/dvb_dummy_fe.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/dvb_dummy_fe.c b/drivers/media/dvb-frontends/dvb_dummy_fe.c
> index 4db679cb70ad..ca86857c3667 100644
> --- a/drivers/media/dvb-frontends/dvb_dummy_fe.c
> +++ b/drivers/media/dvb-frontends/dvb_dummy_fe.c
> @@ -114,12 +114,16 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> if (!state)
> - return NULL;
> + goto err;
>
> /* create dvb_frontend */
> memcpy(&state->frontend.ops, &dvb_dummy_fe_ofdm_ops, sizeof(struct dvb_frontend_ops));
> state->frontend.demodulator_priv = state;
> return &state->frontend;
> +
> +err:
> + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
> + return NULL;
> }
>
> static const struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;
> @@ -131,12 +135,16 @@ struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> if (!state)
> - return NULL;
> + goto err;
>
> /* create dvb_frontend */
> memcpy(&state->frontend.ops, &dvb_dummy_fe_qpsk_ops, sizeof(struct dvb_frontend_ops));
> state->frontend.demodulator_priv = state;
> return &state->frontend;
> +
> +err:
> + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
> + return NULL;
> }
>
> static const struct dvb_frontend_ops dvb_dummy_fe_qam_ops;
> @@ -148,12 +156,16 @@ struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
> /* allocate memory for the internal state */
> state = kzalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL);
> if (!state)
> - return NULL;
> + goto err;
>
> /* create dvb_frontend */
> memcpy(&state->frontend.ops, &dvb_dummy_fe_qam_ops, sizeof(struct dvb_frontend_ops));
> state->frontend.demodulator_priv = state;
> return &state->frontend;
> +
> +err:
> + pr_err("%s: DVB Dummy frontend driver attach failed\n", __func__);
> + return NULL;
> }
>
> static const struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
Cheers,
Mauro
Powered by blists - more mailing lists