From patchwork Wed Jul 6 17:21:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12908408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC04DC43334 for ; Wed, 6 Jul 2022 17:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qxixHkjYKv/l044WdcX9uXjgkppAz/HxJj+emEXYvrM=; b=RuJT9ZIH+V8uiV lTo+QoBwjxQahgY7fbi0/mMKztBa1j2+gFNGTpW6ms5Bbg2ct4yLfr0jd3wWzJJ1W8pHMKSCPk6ux +BpQmF/riaZJXTiGp9vJ6TEEU2lNx1j1t+Ahc7vPVM0NA7Kmz6cTiJ8aGOEyWPlcQQ6WdJVY23NsX HWh4DeIRgfsT9g/Tf/0RMMQ44/xI/EavgDV62C38nMPkE6qhdRB2i43fGVbWm8wyxSRJA6mfEGn4Z QqlY4lQ9orZOgy6vE1MDOSsFSjzkew/8lgbY7kVnoPyg8gVKztd1I9yhNwK/lHVZfWjJeWciYHuJY zFUfHmo0F7RqjXCZDtkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o98kn-00BhhN-Ny; Wed, 06 Jul 2022 17:23:59 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o98iJ-00BgOa-Nr for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2022 17:21:25 +0000 Received: by mail-pg1-x535.google.com with SMTP id o18so13335492pgu.9 for ; Wed, 06 Jul 2022 10:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iQ5noOvGBeEdUsZZU3bl5ZMukN/7ulkT0cDCAalkyJg=; b=IGb49zmS+Sa2ncGd5HLtS7vDXnDSEBOfwavtDQ5eh0Uikr4GMhDpaDg0ML0YSrqgSq ZfNpElMTMwlSwAjCFuuWcEWrNZCCHLUnJFrboD+PC4IU625a9ixYg9vPbiVlqWnoGD0X yoxXQbe0yfEtuZ5f7YBjv1Spki8+7U5kJmx8kz9iSTyufD+FdHMjaOoBq9Y1NO2XpfuW oVQlS7SBI9EUC2F3Ls0ehAdTMHasul2l4SkDElcI7ozow78tFDyub0Z03LlopSYd/xOq NNBnxc7cXDMehUznO2Jr106dp0hiCkE+JF1ixdsogh730neb4NaHM6I1QjuIYCgGlFx6 eEOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iQ5noOvGBeEdUsZZU3bl5ZMukN/7ulkT0cDCAalkyJg=; b=fsUvedPcr7JGVfhpKpsuAFio7yAz8H1eF8bxjmfBSPuSCVytBaU17pIN3mdxfP7REp lApj7BKZ2383QOabDklaTJ+9ipY8ruqTSNkZdLWl6hG5YLboIAaKlQdYvlMWNryNt2c9 X8ZxpDnf8rRW0GrXN2YXCZzNrv2Rt2b7gbLAO+0b7B0pX/5B6P+AonP/QyKSuvasri0t pAclqP/WLRqnicMnjPIGd6dSdeJdXZzXNwbB1TBKuaFM4iUsB7EWWw8mWLnjFyTTcvXF SRS13tHvhUIj4+WhCpJKzeiP9NQQJrLgUYYN/9KuvIEoMJHkrHstGEDg03h+UBHKaUjB 9i0A== X-Gm-Message-State: AJIora9I7DswLNa4W9ZgnyU9v7iUfM2GvzZ0hTRWygHkRqwxBQwz05av 1Im5OmvtgFZWTAL0PJDE86ux4IXWWFQ= X-Google-Smtp-Source: AGRyM1sngHdZngEJQqUY76AjUmgw2ddwaF7gm4SgEXnx0rqBNMDKYZcBMJq0E2JPQtYYTSzJ1CodJg== X-Received: by 2002:a65:6bc8:0:b0:412:9b2c:1700 with SMTP id e8-20020a656bc8000000b004129b2c1700mr3114873pgw.8.1657128078922; Wed, 06 Jul 2022 10:21:18 -0700 (PDT) Received: from localhost.localdomain (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id cd21-20020a056a00421500b0051b32c2a5a7sm24710409pfb.138.2022.07.06.10.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 10:21:18 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Kamal Dasu , Broadcom internal kernel review list , Wolfram Sang , linux-i2c@vger.kernel.org (open list:BROADCOM BRCMSTB I2C DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE) Subject: [PATCH] i2c: brcmstb: Fixed adapter named with optional interrupts Date: Wed, 6 Jul 2022 10:21:15 -0700 Message-Id: <20220706172115.224240-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220706_102123_844876_386D3E44 X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When the adapter is registered without interrupts, we would be showing the following: # i2cdetect -l i2c-3 i2c Broadcom STB : I2C adapter which is visually disturbing, only add the separator if we do have an interrupt. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Signed-off-by: Florian Fainelli --- drivers/i2c/busses/i2c-brcmstb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c index b00f35c0b066..538a51299e04 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -684,9 +684,11 @@ static int brcmstb_i2c_probe(struct platform_device *pdev) adap = &dev->adapter; i2c_set_adapdata(adap, dev); adap->owner = THIS_MODULE; - strlcpy(adap->name, "Broadcom STB : ", sizeof(adap->name)); - if (int_name) + strlcpy(adap->name, "Broadcom STB", sizeof(adap->name)); + if (int_name) { + strlcat(adap->name, ": ", sizeof(adap->name)); strlcat(adap->name, int_name, sizeof(adap->name)); + } adap->algo = &brcmstb_i2c_algo; adap->dev.parent = &pdev->dev; adap->dev.of_node = pdev->dev.of_node;