linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: omaplinuxkernel@gmail.com (Shubhrajyoti Datta)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/6] mfd: mc13xxx: Add i2c driver
Date: Thu, 15 Mar 2012 19:10:42 +0530	[thread overview]
Message-ID: <CAM=Q2cssNF2TSWHjcbG4wsABBXhquYoKq_scC6bDcq8kdoosyQ@mail.gmail.com> (raw)
In-Reply-To: <1331757790-10583-7-git-send-email-marc@cpdesign.com.au>

Hi Marc,

On Thu, Mar 15, 2012 at 2:13 AM, Marc Reilly <marc@cpdesign.com.au> wrote:
> Adds support for mc13xxx family ICs connected via i2c.
>
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
<snip>

> +static int mc13xxx_i2c_probe(struct i2c_client *client,
> + ? ? ? ? ? ? ? const struct i2c_device_id *id)
> +{
> + ? ? ? const struct of_device_id *of_id;
> + ? ? ? struct i2c_driver *idrv = to_i2c_driver(client->dev.driver);
> + ? ? ? struct mc13xxx *mc13xxx;
> + ? ? ? struct mc13xxx_platform_data *pdata = dev_get_platdata(&client->dev);
> + ? ? ? int ret;
> +
> + ? ? ? of_id = of_match_device(mc13xxx_dt_ids, &client->dev);
> + ? ? ? if (of_id)
> + ? ? ? ? ? ? ? idrv->id_table =
> + ? ? ? ? ? ? ? ? ? ? ? &mc13xxx_i2c_device_id[(enum mc13xxx_id) of_id->data];
> +
> + ? ? ? mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
> + ? ? ? if (!mc13xxx)
> + ? ? ? ? ? ? ? return -ENOMEM;
> +
> + ? ? ? dev_set_drvdata(&client->dev, mc13xxx);
> +
> + ? ? ? mc13xxx->dev = &client->dev;
> + ? ? ? mutex_init(&mc13xxx->lock);
> +
> + ? ? ? mc13xxx->regmap = regmap_init_i2c(client, &mc13xxx_regmap_i2c_config);
> + ? ? ? if (IS_ERR(mc13xxx->regmap)) {
> + ? ? ? ? ? ? ? ret = PTR_ERR(mc13xxx->regmap);
> + ? ? ? ? ? ? ? dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n",
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ret);
> + ? ? ? ? ? ? ? dev_set_drvdata(&client->dev, NULL);
Are we  leaking mc13xxx here
May be you can consider using devm* functions ?

>  + ? ? ? ? ? ? ? return ret;
> + ? ? ? }
> +

      parent reply	other threads:[~2012-03-15 13:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 20:43 mc13xxx: add I2C support (now with regmap), V3 Marc Reilly
2012-03-14 20:43 ` [PATCH v3 1/6] regmap: add support for 7_25 format Marc Reilly
2012-03-15 10:44   ` Mark Brown
2012-03-14 20:43 ` [PATCH v3 2/6] regmap: Add support for device with 24 data bits Marc Reilly
2012-03-15 10:46   ` Mark Brown
2012-03-14 20:43 ` [PATCH v3 3/6] mfd: mc13xxx-core: Prepare for separate spi and i2c backends Marc Reilly
2012-03-14 20:43 ` [PATCH v3 4/6] mfd: mc13xxx-core: use regmap for register access Marc Reilly
2012-03-15 17:43   ` Mark Brown
2012-03-14 20:43 ` [PATCH v3 5/6] mfd: mc13xxx-core: Move spi specific code into separate module Marc Reilly
2012-03-14 20:43 ` [PATCH v3 6/6] mfd: mc13xxx: Add i2c driver Marc Reilly
2012-03-14 22:15   ` Fabio Estevam
2012-03-15 13:40   ` Shubhrajyoti Datta [this message]

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='CAM=Q2cssNF2TSWHjcbG4wsABBXhquYoKq_scC6bDcq8kdoosyQ@mail.gmail.com' \
    --to=omaplinuxkernel@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).