linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Jan Glauber <jglauber@cavium.com>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	David Daney <ddaney@caviumnetworks.com>,
	Steven.Hill@caviumnetworks.com
Subject: Re: [PATCH v10 3/8] i2c: thunderx: Add i2c driver for ThunderX SOC
Date: Tue, 23 Aug 2016 22:36:29 +0200	[thread overview]
Message-ID: <20160823203628.GB20872@katana> (raw)
In-Reply-To: <1ead8831e4dd879d452e8bc1a2a33ccba3a74b3d.1465997604.git.jglauber@cavium.com>

[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]


>  i2c-octeon-objs := i2c-cavium.o i2c-octeon-core.o
>  obj-$(CONFIG_I2C_OCTEON)	+= i2c-octeon.o
> +i2c-thunderx-objs := i2c-cavium.o i2c-thunderx-core.o
> +obj-$(CONFIG_I2C_THUNDERX)	+= i2c-thunderx.o

Shouldn't that rather be "i2c-cavium-core.o", "i2c-octeon-platdrv.o",
and "i2c-thunderx-pcidrv.o" for the -objs? I mean, the cavium part is
the core-part...

> +skip:
> +	if (!i2c->sys_freq)
> +		i2c->sys_freq = SYS_FREQ_DEFAULT;
> +
> +	dev_info(dev, "Set system clock to %u\n", i2c->sys_freq);

Too many dev_info IMO, see later.

> +	i2c->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;

Do you really need that?

> +	ret = i2c_add_adapter(&i2c->adap);
> +	if (ret < 0) {
> +		dev_err(dev, "Failed to add i2c adapter\n");

I2C core does error reporting for you meanwhile.

> +		goto out_irq;
> +	}
> +
> +	dev_info(i2c->dev, "probed\n");

I'd think all nice to know dev_info should go here in condensed form.

> +out_irq:
> +	devm_free_irq(dev, i2c->i2c_msix.vector, i2c);

If you need to free irq manually here anyhow, then you don't need the
devm variant.

> +out_msix:
> +	pci_disable_msix(pdev);
> +out_unmap:
> +	iounmap(i2c->twsi_base);
> +	thunder_i2c_clock_disable(dev, i2c->clk);
> +out_release_regions:
> +	pci_release_regions(pdev);
> +out_disable_device:
> +	pci_disable_device(pdev);
> +out_free_i2c:
> +	pci_set_drvdata(pdev, NULL);

Similar to devm_*, there is also pcim_* for PCI devices. You might want
to have a look for those.

> +	devm_kfree(dev, i2c);

Not needed.

> +	return ret;
> +}
> +
> +static void thunder_i2c_remove_pci(struct pci_dev *pdev)
> +{
> +	struct octeon_i2c *i2c = pci_get_drvdata(pdev);
> +	struct device *dev;
> +
> +	if (!i2c)
> +		return;

How should that happen?

> +
> +module_pci_driver(thunder_i2c_pci_driver);
> +
> +MODULE_LICENSE("GPL");

Please add a minimal GPL header at the top of the file, so it is clear
if you mean "v2" or "v2 or later".

> +MODULE_AUTHOR("Fred Martin <fmartin@caviumnetworks.com>");
> +MODULE_DESCRIPTION("I2C-Bus adapter for Cavium ThunderX SOC");
> -- 
> 1.9.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-08-23 20:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 13:51 [PATCH v10 0/8] i2c-octeon and i2c-thunderx driver Jan Glauber
2016-06-15 13:51 ` [PATCH v10 1/8] i2c: octeon: Rename driver to prepare for split Jan Glauber
2016-06-15 13:51 ` [PATCH v10 2/8] i2c: octeon: Split the driver into two parts Jan Glauber
2016-06-15 13:51 ` [PATCH v10 3/8] i2c: thunderx: Add i2c driver for ThunderX SOC Jan Glauber
2016-08-23 20:36   ` Wolfram Sang [this message]
2016-08-23 20:39     ` Wolfram Sang
2016-08-23 21:09       ` Jan Glauber
2016-08-23 21:22     ` Jan Glauber
2016-06-15 13:51 ` [PATCH v10 4/8] i2c: thunderx: Add SMBUS alert support Jan Glauber
2016-08-23 20:57   ` Wolfram Sang
2016-08-23 21:28     ` Jan Glauber
2016-08-23 21:39       ` Wolfram Sang
2016-08-23 21:52         ` Jan Glauber
2016-06-15 13:51 ` [PATCH v10 5/8] i2c: octeon,thunderx: Move register offsets to struct Jan Glauber
2016-06-15 13:51 ` [PATCH v10 6/8] i2c: octeon: Sort include files alphabetically Jan Glauber
2016-06-15 13:51 ` [PATCH v10 7/8] i2c: cavium: Use booleon values for booleon variables Jan Glauber
2016-06-15 13:51 ` [PATCH v10 8/8] i2c: octeon: thunderx: Add MAINTAINERS entry Jan Glauber
2016-08-23 21:00   ` Wolfram Sang

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=20160823203628.GB20872@katana \
    --to=wsa@the-dreams.de \
    --cc=Steven.Hill@caviumnetworks.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=jglauber@cavium.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).