lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 May 2012 16:15:08 +0200
From:	Samuel Ortiz <sameo@...ux.intel.com>
To:	Chanwoo Choi <cw00.choi@...sung.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [RESEND PATCH v2 1/2] MFD: MAX77693: add MAX77693 MFD driver

Hi Choi,

On Tue, Mar 20, 2012 at 10:07:58AM +0900, Chanwoo Choi wrote:
> @@ -0,0 +1,224 @@
> +/*
> + * max77693.c - mfd core driver for the MAX 77693
> + *
> + * Copyright (C) 2011 Samsung Electronics
2012 ?

> +int max77693_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest)
> +{
> +	struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
> +	int ret;
> +
> +	mutex_lock(&max77693->iolock);
> +	ret = i2c_smbus_read_byte_data(i2c, reg);
> +	mutex_unlock(&max77693->iolock);
You don't need this locking as the i2c layer will do it for you.
Also, this definitely look like a good candidate for a regmap API conversion,
I'd appreciate if you could work on that.

> +static struct i2c_driver max77693_i2c_driver = {
> +	.driver = {
> +		   .name = "max77693",
> +		   .owner = THIS_MODULE,
> +	},
> +	.probe = max77693_i2c_probe,
> +	.remove = max77693_i2c_remove,
> +	.id_table = max77693_i2c_id,
> +};
> +
> +static int __init max77693_i2c_init(void)
> +{
> +	return i2c_add_driver(&max77693_i2c_driver);
> +}
> +/* init early so consumer devices can complete system boot */
> +subsys_initcall(max77693_i2c_init);
> +
> +static void __exit max77693_i2c_exit(void)
> +{
> +	i2c_del_driver(&max77693_i2c_driver);
> +}
> +module_exit(max77693_i2c_exit);
You could use module_i2c_driver() here.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ