{"id":806278,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806278/?format=json","project":{"id":56,"url":"http://patchwork.ozlabs.org/api/1.0/projects/56/?format=json","name":"OpenBMC development","link_name":"openbmc","list_id":"openbmc.lists.ozlabs.org","list_email":"openbmc@lists.ozlabs.org","web_url":"http://github.com/openbmc/","scm_url":"","webscm_url":""},"msgid":"<20170827164546.22903-2-clg@kaod.org>","date":"2017-08-27T16:45:45","name":"[linux,dev-4.10,1/2] leds: pca955x: sync with mainline driver","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"ab47822b18f0fecc98f038354fe7be817b2bf741","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/1.0/people/68548/?format=json","name":"Cédric Le Goater","email":"clg@kaod.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openbmc/patch/20170827164546.22903-2-clg@kaod.org/mbox/","series":[{"id":30,"url":"http://patchwork.ozlabs.org/api/1.0/series/30/?format=json","date":"2017-08-27T16:45:44","name":"leds: pca955x: mainline update and I2C error checking","version":1,"mbox":"http://patchwork.ozlabs.org/series/30/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806278/checks/","tags":{},"headers":{"Return-Path":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgLmW5Qbqz9sD9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 03:02:19 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xgLmW4SbJzDqXr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 03:02:19 +1000 (AEST)","from 13.mo6.mail-out.ovh.net (13.mo6.mail-out.ovh.net\n\t[188.165.56.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xgLmP4B7kzDqMh\n\tfor <openbmc@lists.ozlabs.org>; Mon, 28 Aug 2017 03:02:12 +1000 (AEST)","from player787.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo6.mail-out.ovh.net (Postfix) with ESMTP id A4A36103D1F\n\tfor <openbmc@lists.ozlabs.org>; Sun, 27 Aug 2017 18:46:07 +0200 (CEST)","from zorba.kaod.org (LFbn-1-2231-173.w90-76.abo.wanadoo.fr\n\t[90.76.52.173]) (Authenticated sender: clg@kaod.org)\n\tby player787.ha.ovh.net (Postfix) with ESMTPSA id 7D490600072;\n\tSun, 27 Aug 2017 18:46:03 +0200 (CEST)"],"From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","To":"openbmc@lists.ozlabs.org","Subject":"[PATCH linux dev-4.10 1/2] leds: pca955x: sync with mainline driver","Date":"Sun, 27 Aug 2017 18:45:45 +0200","Message-Id":"<20170827164546.22903-2-clg@kaod.org>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170827164546.22903-1-clg@kaod.org>","References":"<20170827164546.22903-1-clg@kaod.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Ovh-Tracer-Id":"17820462253373557506","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledruddtgddutdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>","Cc":"Andrew Jeffery <andrew@aj.id.au>, =?utf-8?q?C=C3=A9dric_Le_Goater?=\n\t<clg@kaod.org>","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"The result should be in sync with kernel 4.14 once the gpio extension\nis merged in the pca955x driver.\n\nSigned-off-by: Cédric Le Goater <clg@kaod.org>\n---\n drivers/leds/leds-pca955x.c | 49 ++++++++++++++++++---------------------------\n 1 file changed, 19 insertions(+), 30 deletions(-)","diff":"diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c\nindex 0217bac2f47b..f062d1e7640f 100644\n--- a/drivers/leds/leds-pca955x.c\n+++ b/drivers/leds/leds-pca955x.c\n@@ -342,7 +342,8 @@ pca955x_pdata_of_init(struct i2c_client *client, struct pca955x_chipdef *chip)\n \t\treturn ERR_PTR(-ENOMEM);\n \n \tpdata->leds = devm_kzalloc(&client->dev,\n-\t\t\t   sizeof(struct pca955x_led) * chip->bits, GFP_KERNEL);\n+\t\t\t\t   sizeof(struct pca955x_led) * chip->bits,\n+\t\t\t\t   GFP_KERNEL);\n \tif (!pdata->leds)\n \t\treturn ERR_PTR(-ENOMEM);\n \n@@ -430,16 +431,14 @@ static int pca955x_probe(struct i2c_client *client,\n \t\t\t\"slave address 0x%02x\\n\",\n \t\t\tclient->name, chip->bits, client->addr);\n \n-\tif (!i2c_check_functionality(adapter, I2C_FUNC_I2C))\n+\tif (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))\n \t\treturn -EIO;\n \n-\tif (pdata) {\n-\t\tif (pdata->num_leds != chip->bits) {\n-\t\t\tdev_err(&client->dev, \"board info claims %d LEDs\"\n-\t\t\t\t\t\" on a %d-bit chip\\n\",\n-\t\t\t\t\tpdata->num_leds, chip->bits);\n-\t\t\treturn -ENODEV;\n-\t\t}\n+\tif (pdata->num_leds != chip->bits) {\n+\t\tdev_err(&client->dev,\n+\t\t\t\"board info claims %d LEDs on a %d-bit chip\\n\",\n+\t\t\tpdata->num_leds, chip->bits);\n+\t\treturn -ENODEV;\n \t}\n \n \tpca955x = devm_kzalloc(&client->dev, sizeof(*pca955x), GFP_KERNEL);\n@@ -458,12 +457,10 @@ static int pca955x_probe(struct i2c_client *client,\n \tpca955x->chipdef = chip;\n \n \tfor (i = 0; i < chip->bits; i++) {\n-\t\tstruct pca955x_led *pdata_led = &pdata->leds[i];\n-\n \t\tpca955x_led = &pca955x->leds[i];\n \t\tpca955x_led->led_num = i;\n \t\tpca955x_led->pca955x = pca955x;\n-\t\tpca955x_led->type = pdata_led->type;\n+\t\tpca955x_led->type = pdata->leds[i].type;\n \n \t\tswitch (pca955x_led->type) {\n \t\tcase PCA955X_TYPE_NONE:\n@@ -476,27 +473,20 @@ static int pca955x_probe(struct i2c_client *client,\n \t\t\t * Platform data can specify LED names and\n \t\t\t * default triggers\n \t\t\t */\n-\t\t\tif (pdata) {\n-\t\t\t\tif (pdata->leds[i].name)\n-\t\t\t\t\tsnprintf(pca955x_led->name,\n-\t\t\t\t\t\t sizeof(pca955x_led->name),\n-\t\t\t\t\t\t \"pca955x:%s\",\n-\t\t\t\t\t\t pdata->leds[i].name);\n-\t\t\t\tif (pdata->leds[i].default_trigger)\n-\t\t\t\t\tpca955x_led->led_cdev.default_trigger =\n-\t\t\t\t\t\tpdata->leds[i].default_trigger;\n-\t\t\t} else {\n+\t\t\tif (pdata->leds[i].name)\n \t\t\t\tsnprintf(pca955x_led->name,\n-\t\t\t\t\t sizeof(pca955x_led->name),\n-\t\t\t\t\t \"pca955x:%d\", i);\n-\t\t\t}\n+\t\t\t\t\tsizeof(pca955x_led->name), \"pca955x:%s\",\n+\t\t\t\t\tpdata->leds[i].name);\n+\t\t\tif (pdata->leds[i].default_trigger)\n+\t\t\t\tpca955x_led->led_cdev.default_trigger =\n+\t\t\t\t\tpdata->leds[i].default_trigger;\n \n \t\t\tpca955x_led->led_cdev.name = pca955x_led->name;\n \t\t\tpca955x_led->led_cdev.brightness_set_blocking =\n \t\t\t\tpca955x_led_set;\n \n \t\t\terr = devm_led_classdev_register(&client->dev,\n-\t\t\t\t\t\t &pca955x_led->led_cdev);\n+\t\t\t\t\t\t\t&pca955x_led->led_cdev);\n \t\t\tif (err)\n \t\t\t\treturn err;\n \n@@ -536,11 +526,10 @@ static int pca955x_probe(struct i2c_client *client,\n \t\t\tpca955x->gpio.parent = NULL;\n \t\t\tdev_warn(&client->dev, \"could not add gpiochip\\n\");\n \t\t\treturn err;\n-\t\t} else {\n-\t\t\tdev_info(&client->dev, \"gpios %i...%i\\n\",\n-\t\t\t\t pca955x->gpio.base, pca955x->gpio.base +\n-\t\t\t\t pca955x->gpio.ngpio - 1);\n \t\t}\n+\t\tdev_info(&client->dev, \"gpios %i...%i\\n\",\n+\t\t\t pca955x->gpio.base, pca955x->gpio.base +\n+\t\t\t pca955x->gpio.ngpio - 1);\n \t}\n #endif\n \n","prefixes":["linux","dev-4.10","1/2"]}