From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 BF92BC43381 for ; Fri, 1 Mar 2019 05:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 970292084F for ; Fri, 1 Mar 2019 05:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728891AbfCAFiL (ORCPT ); Fri, 1 Mar 2019 00:38:11 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42691 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728052AbfCAFiJ (ORCPT ); Fri, 1 Mar 2019 00:38:09 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 Mar 2019 07:38:07 +0200 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x215brYY016903; Fri, 1 Mar 2019 07:38:04 +0200 From: Parav Pandit To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.lkml@markovi.net, davem@davemloft.net, gregkh@linuxfoundation.org, jiri@mellanox.com Cc: parav@mellanox.com Subject: [RFC net-next 3/8] modpost: Add support for subdev device id table Date: Thu, 28 Feb 2019 23:37:47 -0600 Message-Id: <1551418672-12822-4-git-send-email-parav@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551418672-12822-1-git-send-email-parav@mellanox.com> References: <1551418672-12822-1-git-send-email-parav@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support to parse subdev module device id table. Signed-off-by: Parav Pandit --- scripts/mod/devicetable-offsets.c | 4 ++++ scripts/mod/file2alias.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index 2930044..77f6b6e 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -225,5 +225,9 @@ int main(void) DEVID_FIELD(typec_device_id, svid); DEVID_FIELD(typec_device_id, mode); + DEVID(subdev_id); + DEVID_FIELD(subdev_id, vendor_id); + DEVID_FIELD(subdev_id, device_id); + return 0; } diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a37af7d..be89e8e 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -1287,6 +1287,20 @@ static int do_typec_entry(const char *filename, void *symval, char *alias) return 1; } +/* Looks like: subdev:vNdN. */ +static int do_subdev_entry(const char *filename, void *symval, char *alias) +{ + DEF_FIELD(symval, subdev_id, vendor_id); + DEF_FIELD(symval, subdev_id, device_id); + + strcpy(alias, "subdev:"); + ADD(alias, "v", 1, vendor_id); + ADD(alias, "d", 1, device_id); + + add_wildcard(alias); + return 1; +} + /* Does namelen bytes of name exactly match the symbol? */ static bool sym_is(const char *name, unsigned namelen, const char *symbol) { @@ -1357,6 +1371,7 @@ static void do_table(void *symval, unsigned long size, {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry}, {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry}, {"typec", SIZE_typec_device_id, do_typec_entry}, + {"subdev", SIZE_subdev_id, do_subdev_entry}, }; /* Create MODULE_ALIAS() statements. -- 1.8.3.1