Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816069/?format=api
{ "id": 816069, "url": "http://patchwork.ozlabs.org/api/patches/816069/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920070135.31379-4-clg@kaod.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170920070135.31379-4-clg@kaod.org>", "list_archive_url": null, "date": "2017-09-20T07:01:32", "name": "[v2,3/6] smbus: add a smbus_eeprom_init_one() routine", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d0c9267f158cac62c4123f81d89433e0199c06f8", "submitter": { "id": 68548, "url": "http://patchwork.ozlabs.org/api/people/68548/?format=api", "name": "Cédric Le Goater", "email": "clg@kaod.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920070135.31379-4-clg@kaod.org/mbox/", "series": [ { "id": 4038, "url": "http://patchwork.ozlabs.org/api/series/4038/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4038", "date": "2017-09-20T07:01:29", "name": "aspeed: add a witherspoon-bmc machine", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/4038/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816069/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816069/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxrL91jpGz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 17:03:13 +1000 (AEST)", "from localhost ([::1]:47109 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duZ2N-00052p-8z\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 03:03:11 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:47855)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1duZ1d-00051C-8g\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:26 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1duZ1Z-0000HO-9k\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:25 -0400", "from 4.mo2.mail-out.ovh.net ([87.98.172.75]:59857)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <clg@kaod.org>) id 1duZ1Y-0000FC-LP\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:21 -0400", "from player157.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo2.mail-out.ovh.net (Postfix) with ESMTP id 41DE8AA495\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 09:02:19 +0200 (CEST)", "from zorba.kaod.org.com (LFbn-1-2231-173.w90-76.abo.wanadoo.fr\n\t[90.76.52.173]) (Authenticated sender: clg@kaod.org)\n\tby player157.ha.ovh.net (Postfix) with ESMTPSA id 053A450009A;\n\tWed, 20 Sep 2017 09:02:12 +0200 (CEST)" ], "From": "=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>", "To": "Peter Maydell <peter.maydell@linaro.org>", "Date": "Wed, 20 Sep 2017 09:01:32 +0200", "Message-Id": "<20170920070135.31379-4-clg@kaod.org>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170920070135.31379-1-clg@kaod.org>", "References": "<20170920070135.31379-1-clg@kaod.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-Ovh-Tracer-Id": "1331658115682896657", "X-VR-SPAMSTATE": "OK", "X-VR-SPAMSCORE": "-100", "X-VR-SPAMCAUSE": "gggruggvucftvghtrhhoucdtuddrfeelledrheekgdduudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm", "Content-Transfer-Encoding": "quoted-printable", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "87.98.172.75", "Subject": "[Qemu-devel] [PATCH v2 3/6] smbus: add a smbus_eeprom_init_one()\n\troutine", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "Andrew Jeffery <andrew@aj.id.au>, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?b?w6k=?= <f4bug@amsat.org>,\n\tqemu-devel@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_?=\n\t=?utf-8?q?Goater?= <clg@kaod.org>, \tJoel Stanley <joel@jms.id.au>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "This is an helper routine to add a single EEPROM on an I2C bus. It can\nbe directly used by smbus_eeprom_init() which adds a certain number of\nEEPROMs on mips and x86 machines.\n\nSigned-off-by: Cédric Le Goater <clg@kaod.org>\n---\n hw/i2c/smbus_eeprom.c | 16 +++++++++++-----\n include/hw/i2c/smbus.h | 1 +\n 2 files changed, 12 insertions(+), 5 deletions(-)", "diff": "diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c\nindex b13ec0fe7a2a..2d24a4cd59bf 100644\n--- a/hw/i2c/smbus_eeprom.c\n+++ b/hw/i2c/smbus_eeprom.c\n@@ -140,6 +140,16 @@ static void smbus_eeprom_register_types(void)\n \n type_init(smbus_eeprom_register_types)\n \n+void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom_buf)\n+{\n+ DeviceState *dev;\n+\n+ dev = qdev_create((BusState *) smbus, \"smbus-eeprom\");\n+ qdev_prop_set_uint8(dev, \"address\", address);\n+ qdev_prop_set_ptr(dev, \"data\", eeprom_buf);\n+ qdev_init_nofail(dev);\n+}\n+\n void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,\n const uint8_t *eeprom_spd, int eeprom_spd_size)\n {\n@@ -150,10 +160,6 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,\n }\n \n for (i = 0; i < nb_eeprom; i++) {\n- DeviceState *eeprom;\n- eeprom = qdev_create((BusState *)smbus, \"smbus-eeprom\");\n- qdev_prop_set_uint8(eeprom, \"address\", 0x50 + i);\n- qdev_prop_set_ptr(eeprom, \"data\", eeprom_buf + (i * 256));\n- qdev_init_nofail(eeprom);\n+ smbus_eeprom_init_one(smbus, 0x50 + i, eeprom_buf + (i * 256));\n }\n }\ndiff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h\nindex 544bbc19574f..666cdeb04c07 100644\n--- a/include/hw/i2c/smbus.h\n+++ b/include/hw/i2c/smbus.h\n@@ -77,6 +77,7 @@ int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data);\n int smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data,\n int len);\n \n+void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom_buf);\n void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,\n const uint8_t *eeprom_spd, int size);\n \n", "prefixes": [ "v2", "3/6" ] }