LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] media: dvb: mt352, change i2c read buffer from stack, to kernel space
@ 2021-10-07 11:44 rkardell
  2021-11-19 16:16 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: rkardell @ 2021-10-07 11:44 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab, linux-kernel

Solve problem with initialization of Mega Sky 580 USB DVB (and other 
using mt352), error when reading i2c id.


Signed-off-by: rkl099 <rkardell@mida.se>
---
  drivers/media/dvb-frontends/mt352.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/mt352.c 
b/drivers/media/dvb-frontends/mt352.c
index 399d5c519..d7f33558d 100644
--- a/drivers/media/dvb-frontends/mt352.c
+++ b/drivers/media/dvb-frontends/mt352.c
@@ -69,7 +69,7 @@ static int mt352_read_register(struct mt352_state* 
state, u8 reg)
  {
         int ret;
         u8 b0 [] = { reg };
-       u8 b1 [] = { 0 };
+    u8 *b1=kmalloc(1,GFP_KERNEL);
         struct i2c_msg msg [] = { { .addr = state->config.demod_address,
                                     .flags = 0,
                                     .buf = b0, .len = 1 },
@@ -82,12 +82,15 @@ static int mt352_read_register(struct mt352_state* 
state, u8 reg)
         if (ret != 2) {
                 printk("%s: readreg error (reg=%d, ret==%i)\n",
                        __func__, reg, ret);
+               kfree(b1);
                 return ret;
         }
-
-       return b1[0];
+    ret=b1[0];
+    kfree(b1);
+       return ret;
  }

+
  static int mt352_sleep(struct dvb_frontend* fe)
  {
         static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };
-- 
2.30.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: dvb: mt352, change i2c read buffer from stack, to kernel space
  2021-10-07 11:44 [PATCH] media: dvb: mt352, change i2c read buffer from stack, to kernel space rkardell
@ 2021-11-19 16:16 ` Mauro Carvalho Chehab
  2021-11-19 16:17   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-11-19 16:16 UTC (permalink / raw)
  To: rkardell; +Cc: linux-media, linux-kernel

Em Thu, 7 Oct 2021 13:44:06 +0200
rkardell <rkardell@mida.se> escreveu:

> Solve problem with initialization of Mega Sky 580 USB DVB (and other 
> using mt352), error when reading i2c id.

This patch is full of 0xa0 characters instead of spaces, causing it
to be rejected. Probably either your e-mailer of your text editor is doing
something wrong. Please fix and resend.

Thanks!
Mauro

> 
> 
> Signed-off-by: rkl099 <rkardell@mida.se>
> ---
>   drivers/media/dvb-frontends/mt352.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/dvb-frontends/mt352.c 
> b/drivers/media/dvb-frontends/mt352.c
> index 399d5c519..d7f33558d 100644
> --- a/drivers/media/dvb-frontends/mt352.c
> +++ b/drivers/media/dvb-frontends/mt352.c
> @@ -69,7 +69,7 @@ static int mt352_read_register(struct mt352_state* 
> state, u8 reg)
>   {
>          int ret;
>          u8 b0 [] = { reg };
> -       u8 b1 [] = { 0 };
> +    u8 *b1=kmalloc(1,GFP_KERNEL);
>          struct i2c_msg msg [] = { { .addr = state->config.demod_address,
>                                      .flags = 0,
>                                      .buf = b0, .len = 1 },
> @@ -82,12 +82,15 @@ static int mt352_read_register(struct mt352_state* 
> state, u8 reg)
>          if (ret != 2) {
>                  printk("%s: readreg error (reg=%d, ret==%i)\n",
>                         __func__, reg, ret);
> +               kfree(b1);
>                  return ret;
>          }
> -
> -       return b1[0];
> +    ret=b1[0];
> +    kfree(b1);
> +       return ret;
>   }
> 
> +
>   static int mt352_sleep(struct dvb_frontend* fe)
>   {
>          static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: dvb: mt352, change i2c read buffer from stack, to kernel space
  2021-11-19 16:16 ` Mauro Carvalho Chehab
@ 2021-11-19 16:17   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-11-19 16:17 UTC (permalink / raw)
  To: rkardell; +Cc: linux-media, linux-kernel

Em Fri, 19 Nov 2021 16:16:12 +0000
Mauro Carvalho Chehab <mchehab@kernel.org> escreveu:

> Em Thu, 7 Oct 2021 13:44:06 +0200
> rkardell <rkardell@mida.se> escreveu:
> 
> > Solve problem with initialization of Mega Sky 580 USB DVB (and other 
> > using mt352), error when reading i2c id.
> 
> This patch is full of 0xa0 characters instead of spaces, causing it
> to be rejected. Probably either your e-mailer of your text editor is doing
> something wrong. Please fix and resend.
> 
> Thanks!
> Mauro
> 
> > 
> > 
> > Signed-off-by: rkl099 <rkardell@mida.se>

Ah, the SoB and the "From:" should use your real name.

Regards,
Mauro


> > ---
> >   drivers/media/dvb-frontends/mt352.c | 9 ++++++---
> >   1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/media/dvb-frontends/mt352.c 
> > b/drivers/media/dvb-frontends/mt352.c
> > index 399d5c519..d7f33558d 100644
> > --- a/drivers/media/dvb-frontends/mt352.c
> > +++ b/drivers/media/dvb-frontends/mt352.c
> > @@ -69,7 +69,7 @@ static int mt352_read_register(struct mt352_state* 
> > state, u8 reg)
> >   {
> >          int ret;
> >          u8 b0 [] = { reg };
> > -       u8 b1 [] = { 0 };
> > +    u8 *b1=kmalloc(1,GFP_KERNEL);
> >          struct i2c_msg msg [] = { { .addr = state->config.demod_address,
> >                                      .flags = 0,
> >                                      .buf = b0, .len = 1 },
> > @@ -82,12 +82,15 @@ static int mt352_read_register(struct mt352_state* 
> > state, u8 reg)
> >          if (ret != 2) {
> >                  printk("%s: readreg error (reg=%d, ret==%i)\n",
> >                         __func__, reg, ret);
> > +               kfree(b1);
> >                  return ret;
> >          }
> > -
> > -       return b1[0];
> > +    ret=b1[0];
> > +    kfree(b1);
> > +       return ret;
> >   }
> > 
> > +
> >   static int mt352_sleep(struct dvb_frontend* fe)
> >   {
> >          static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-19 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 11:44 [PATCH] media: dvb: mt352, change i2c read buffer from stack, to kernel space rkardell
2021-11-19 16:16 ` Mauro Carvalho Chehab
2021-11-19 16:17   ` Mauro Carvalho Chehab

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).