From patchwork Tue Sep 15 09:11:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alain Volmat X-Patchwork-Id: 254728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8EB7C43461 for ; Tue, 15 Sep 2020 09:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75B292078D for ; Tue, 15 Sep 2020 09:12:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="KVJs7Bee" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726371AbgIOJMI (ORCPT ); Tue, 15 Sep 2020 05:12:08 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:60358 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726130AbgIOJLv (ORCPT ); Tue, 15 Sep 2020 05:11:51 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08F98H9f022258; Tue, 15 Sep 2020 11:11:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=a2n/VyvPL5cAo3F9MDe6vyiMgotrwIrVTK+SWyJLDSw=; b=KVJs7BeeDzxet4I8mZSqnmowPgBQk6tXj46ILQIpe4DZ8lC++wmMx/jOK3mbJLA6z5oq Hjzg7j/vJfJBm1PRQiaeVC2xvom049KRmzsHzHqqqCT9U50qfMlrM7nmB76i4wlZUSxm wQPzCjp9tir9Bjj8115ZYgPqasuUiVhq7Om5OyJTF5MM4sFuH3qukIVfJ5enkQrbXv3F zCiGbYWMsoV5BKQyRS/jS9pS6eqFco/h/g8D6BSVM297Ei2Ij/hWG0QXI/mYFc0BDBAQ Fvwr0PgCPdXs2gsCUNHXCie/5/S81VkYiYjR7onHGquXbAEnWaSQCdzSCxrfmIIFocJu vw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 33gn7gxnpv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Sep 2020 11:11:32 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CEEEB10002A; Tue, 15 Sep 2020 11:11:31 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3FA592A447E; Tue, 15 Sep 2020 11:11:31 +0200 (CEST) Received: from localhost (10.75.127.49) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 15 Sep 2020 11:11:30 +0200 From: Alain Volmat To: , CC: , , , , , , Subject: [PATCH 1/2] i2c: stm32: fix slot id after introduction of host-notify support Date: Tue, 15 Sep 2020 11:11:30 +0200 Message-ID: <1600161090-9899-1-git-send-email-alain.volmat@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-15_05:2020-09-15,2020-09-15 signatures=0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Commit 68302245720a ("i2c: stm32f7: Add SMBus Host-Notify protocol support") added a new slot specific for handling host-notify however failed to update the previous slot ID leading to having the 7bit address only slot with the wrong number. Signed-off-by: Alain Volmat --- drivers/i2c/busses/i2c-stm32f7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index b401940c5580..0880f6a4cd44 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1355,7 +1355,7 @@ static int stm32f7_i2c_get_free_slave_id(struct stm32f7_i2c_dev *i2c_dev, } for (i = STM32F7_I2C_MAX_SLAVE - 1; i > 0; i--) { - if (i == 1 && (slave->flags & I2C_CLIENT_TEN)) + if (i == 2 && (slave->flags & I2C_CLIENT_TEN)) continue; if (!i2c_dev->slave[i]) { *id = i;