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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B567DBAB974C0544994013492B949F8E38123AC1B6@EXMAIL03.scwf.nsc.com>
Date:	Thu, 17 Nov 2011 21:43:06 -0800
From:	"Kim, Milo" <Milo.Kim@...com>
To:	"Anton Vorontsov" <cbouatmailru@...il.com>
cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dwmw2@...radead.org" <dwmw2@...radead.org>
Subject: [PATCH] power: lp8727 - add supported i2c functionality check
 routine

Hi, Anton

I send the patch for lp8727 charger driver.

Signed-off-by: Woogyom Kim <milo.kim@...com>

From c72a8a461d19ace81d9d092e8a23de741dd2144f Mon Sep 17 00:00:00 2001
From: Milo(Woogyom) Kim <milo.kim@...com>
Date: Fri, 18 Nov 2011 14:30:59 +0900
Subject: [PATCH] power : lp8727 - add supported i2c functionality check routine

lp8727 i2c r/w functions are based on SMBUS I2C BLOCK.
So the driver needs to check whether i2c bus supports this functionality or not.
---
 drivers/power/lp8727_charger.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index 6d13f83..b15b575 100755
--- a/drivers/power/lp8727_charger.c
+++ b/drivers/power/lp8727_charger.c
@@ -425,6 +425,9 @@ static int lp8727_probe(struct i2c_client *cl, const struct i2c_device_id *id)
 	struct lp8727_chg *pchg;
 	int ret;
 
+	if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
+		return -EIO;
+
 	pchg = kzalloc(sizeof(*pchg), GFP_KERNEL);
 	if (!pchg)
 		return -ENOMEM;
-- 
1.7.4.1

Thanks & BR
Milo (Woogyom)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ