From patchwork Wed Feb 22 19:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 60666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp767529wrd; Wed, 22 Feb 2023 11:26:51 -0800 (PST) X-Google-Smtp-Source: AK7set/m/kTS/1gwzckcewdgbQ/8gyCLI1Vz2BOII6apqz3xC8zI3dRBfTPYsIUQWi24Fr6LDkUK X-Received: by 2002:a05:6a21:788f:b0:be:c5de:7157 with SMTP id bf15-20020a056a21788f00b000bec5de7157mr1413503pzc.53.1677094010816; Wed, 22 Feb 2023 11:26:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677094010; cv=none; d=google.com; s=arc-20160816; b=un2zMZzznG6zkAbaqfJD1PKqG33/VS25JAGkur1XPmioxx1LTD1SX/2AwbqjqUYxWq 4hYg//2ZF8eoM3jIOHw2Mz31fR2laUWgU9LcZCaUlOWX044DLwx/ELyXq47tDuGrGm47 XoXp6cPNOi9sfe4CiuP9mcGYaiYb+ut3HpzUUY7RluvFxaHzP0NYNIIOK3cZvcJohWSI ZB0c2RceJsNJt0bquTnqEA9jTTbGHl/npiHu91hoWqGltFWD1qk/p7RT62saAIGXi65e M2wM1VZHba7U9LdzWOU84zID4bUlV3VJIajTqZcmeQkdrA64KdVijIKzhpDeUR/NtiOm uV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s4kIBTdwHgvnp0JR5GqHrVoFL9IUarVdZp5dipeTXo0=; b=Jpk1/HDyU5LMHPcARw3L77Fv+RPj9wJfyYZJgaE63QlyWRDAi3+NWCJk3+RAQam2fW uwzBhh5wJEZ6dfh+P5+L8Wd3GDWh4qyu0LncHm5RyMTPl00Hhn+u9ts1R16w1S8AX/4R 7o0kgQn5dVkl6R3g183KQqLKLOSiwPmOfkUqRMSt3SizlM589XnT8+VbNuNrlRV2XMUB CxRpCo588RVl8Xt5GCsqU3E9pDgQ3Qzmsf7LcLEulAgvqoTKHOArHV98CQJEaXUR6KPZ ZPLYB/ZXIBpMXLrUDApteYwkHpDh1pPllDL9M9KKNKvG539CVOpr9XnL2H1xA6rGUTo2 Ussw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=V9JtjODU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a17090abc8f00b00233df82a93csi7863279pjr.64.2023.02.22.11.26.37; Wed, 22 Feb 2023 11:26:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=V9JtjODU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbjBVTZA (ORCPT + 99 others); Wed, 22 Feb 2023 14:25:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbjBVTYk (ORCPT ); Wed, 22 Feb 2023 14:24:40 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDF573C7B2; Wed, 22 Feb 2023 11:24:22 -0800 (PST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31MHg4vW025743; Wed, 22 Feb 2023 19:24:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=s4kIBTdwHgvnp0JR5GqHrVoFL9IUarVdZp5dipeTXo0=; b=V9JtjODUigx3ghFDyZ5u18KJVOJwzQRMP5acfz78dHQ+ek7HMWE/7cV8ARna+z0KmY/x z+J8YL+oP/lp1CLpf44zv+wt41WYimm0Le3ozrvxOE1kKqUodLzwv9mQ8CU+ii3afBDE dfqWdmtRm0/Y9xe/5xjpBBCR+LPryrVhlv/6N+bjsDir/nnLuGhExji/3b0WDO9vQTrW njQcCY50vb8oNb2+xxlgMNhbgHtGuVWlQGDkt0D85m/2YSNwUvdHWJFBmWwVFwVRsDGB DLI+QUN45ySSUuJSgASQ5/N9zNYvjPBAd7Vmh1BCUPnucnPF8wr8cdfBokhuNuZnJyDw ig== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nwqp2ju0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Feb 2023 19:24:08 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31MIQA4I005305; Wed, 22 Feb 2023 19:24:07 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3ntpa78byr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Feb 2023 19:24:07 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31MJO6XV42336840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Feb 2023 19:24:06 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1860B5805A; Wed, 22 Feb 2023 19:24:06 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6C1858051; Wed, 22 Feb 2023 19:24:04 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.160.56.187]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 22 Feb 2023 19:24:04 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: rostedt@goodmis.org, linux-trace-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mhiramat@kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@aj.id.au, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, eajames@linux.ibm.com Subject: [PATCH v6 6/6] fsi: Use of_match_table for bus matching if specified Date: Wed, 22 Feb 2023 13:23:54 -0600 Message-Id: <20230222192354.4055034-7-eajames@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230222192354.4055034-1-eajames@linux.ibm.com> References: <20230222192354.4055034-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: xW6oFghqZIxoRFbWkwkhJ82mvlz_ELEq X-Proofpoint-GUID: xW6oFghqZIxoRFbWkwkhJ82mvlz_ELEq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-22_07,2023-02-22_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302220164 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758560529535502542?= X-GMAIL-MSGID: =?utf-8?q?1758560529535502542?= Since we have two scom drivers, use the standard of matching if the driver specifies a table so that the right devices go to the right driver. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 11 +++++++++-- drivers/fsi/fsi-scom.c | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index b77013b9d8a7..ca4a9634fbc3 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -1375,8 +1376,14 @@ static int fsi_bus_match(struct device *dev, struct device_driver *drv) if (id->engine_type != fsi_dev->engine_type) continue; if (id->version == FSI_VERSION_ANY || - id->version == fsi_dev->version) - return 1; + id->version == fsi_dev->version) { + if (drv->of_match_table) { + if (of_driver_match_device(dev, drv)) + return 1; + } else { + return 1; + } + } } return 0; diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index bcb756dc9866..61dbda9dbe2b 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -587,6 +588,12 @@ static int scom_remove(struct device *dev) return 0; } +static const struct of_device_id scom_of_ids[] = { + { .compatible = "ibm,fsi2pib" }, + { } +}; +MODULE_DEVICE_TABLE(of, scom_of_ids); + static const struct fsi_device_id scom_ids[] = { { .engine_type = FSI_ENGID_SCOM, @@ -600,6 +607,7 @@ static struct fsi_driver scom_drv = { .drv = { .name = "scom", .bus = &fsi_bus_type, + .of_match_table = scom_of_ids, .probe = scom_probe, .remove = scom_remove, }