All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Akihiro TSUKADA <tskd08@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [RFC/PATCH] dvb-core: add template code for i2c binding model
Date: Mon, 5 Jan 2015 10:24:45 -0200	[thread overview]
Message-ID: <20150105102445.671d5c1e@concha.lan> (raw)
In-Reply-To: <54AA8032.30307@gmail.com>

Em Mon, 05 Jan 2015 21:14:42 +0900
Akihiro TSUKADA <tskd08@gmail.com> escreveu:

> > The only thing I noticed is that it is causing some warnings at
> > dmesg about trying to create already created sysfs nodes, when the
> > driver is removed/reinserted.
> > 
> > Probably, the remove callback is called too soon or too late.
> 
> I don't have any warnings in syslog when reinserting earth-pt3 + tc90522,
> but I'll look into it.

This seems to be an already existing bug at cx231xx, as I'm also getting
those without those patches.

> 
> > -struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
> > -				    struct i2c_adapter *i2c)
> > +static int mb86a20s_probe(struct i2c_client *i2c,
> > +			  const struct i2c_device_id *id)
> >  {
> > +	struct dvb_frontend *fe;
> >  	struct mb86a20s_state *state;
> >  	u8	rev;
> >  
> >  	dev_dbg(&i2c->dev, "%s called.\n", __func__);
> >  
> > -	/* allocate memory for the internal state */
> > -	state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL);
> > -	if (state == NULL) {
> > -		dev_err(&i2c->dev,
> > -			"%s: unable to allocate memory for state\n", __func__);
> > -		goto error;
> > -	}
> > +	fe = i2c_get_clientdata(i2c);
> > +	state = fe->demodulator_priv;
> >  
> >  	/* setup the state */
> > -	state->config = config;
> > +	memcpy(&state->config, i2c->dev.platform_data, sizeof(state->config));
> >  	state->i2c = i2c;
> >  
> >  	/* create dvb_frontend */
> > -	memcpy(&state->frontend.ops, &mb86a20s_ops,
> > +	memcpy(&fe->ops, &mb86a20s_ops,
> >  		sizeof(struct dvb_frontend_ops));
> 
> btw,
> we can go with "mb86a20s_param = { .ops.fe_ops = &mb86a20s_ops,}" insead.
> 
> --
> regards,
> akihiro


-- 

Cheers,
Mauro

  reply	other threads:[~2015-01-05 12:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 10:49 [RFC/PATCH] dvb-core: add template code for i2c binding model tskd08
2014-12-05 10:55 ` [PATCH 0/5] ports to dvb-core i2c template code tskd08
2014-12-05 10:55 ` [PATCH 1/5] dvb: qm1d1c0042: use dvb-core i2c binding model template tskd08
2014-12-05 10:55 ` [PATCH 2/5] dvb: mxl301rf: " tskd08
2014-12-05 10:55 ` [PATCH 3/5] dvb: tc90522: " tskd08
2014-12-05 10:55 ` [PATCH 4/5] dvb: tc90522: remove a redundant state variable tskd08
2014-12-05 10:55 ` [PATCH 5/5] dvb: pci/pt3: use dvb-core i2c binding model template tskd08
2014-12-26 11:00 ` [RFC/PATCH] dvb-core: add template code for i2c binding model Akihiro TSUKADA
2014-12-30 13:10 ` Mauro Carvalho Chehab
2014-12-30 20:01   ` Mauro Carvalho Chehab
2015-01-05 12:14     ` Akihiro TSUKADA
2015-01-05 12:24       ` Mauro Carvalho Chehab [this message]
2015-01-05 11:59   ` Akihiro TSUKADA
2015-01-13 18:54 ` Antti Palosaari
2015-01-15 11:20   ` Akihiro TSUKADA

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=20150105102445.671d5c1e@concha.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=tskd08@gmail.com \
    /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.