Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp214326imb; Thu, 28 Feb 2019 21:40:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzJk4Mhab9HVd+QiERv2thaQ/iaL+SDETXzG2voZRt+Zci5N+mf2DUk1b6dYhWDWhU+K+iD X-Received: by 2002:a17:902:bd47:: with SMTP id b7mr3630381plx.336.1551418807363; Thu, 28 Feb 2019 21:40:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551418807; cv=none; d=google.com; s=arc-20160816; b=Y4Pgc55u2DGvJ0X2vdw3BdLn34tp+FMj2KXNSEXBr3hgWjSnUP11dvpszOl3tvlazm aIgeMudm30nYixGmyXT6RoSiGfFDWavLAaZPuzH6WOZE9jSSFJ+ySPo1REPkf9xKrGIN 6n57zwMtKJhk6mVpj4OdD8C2CiXK+LstrxOm7q4SEYvaEwq96REUWyC9Z++5Wi+BbDnN 0rDFOwCvPNoYLeYhdcgmNs7dR11/nwHwezEPuEU5SIf3o4BERg3ELwW6PsaMhwqkwn85 tlpoyXK1yXjt95bQidqPw/VJtkcsAdaZiCPcllJ10B9k69XbCIFxkiuPRlOBeck9ir1O 2imw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=v0maKH6F3I+wiOOry9p9FpkimB0Hy8/4uWYX9lhcq5k=; b=RbkrETprSsVTdeSzNJApUMW/fkXdPJIP2+egeS7+NvdJ9LGNlNrc0jB3u7P1sWQ2ua bGY3wL4RErFB1iO8J3iShUGD9nsSBlWh1Ll+WCdanSm3ObV2D1lYXbiCBMvg7ZVl+4jn fn6ctWLF+xK+EVMwmNVp2mGUhCwsG/MM70BANWEscwMs3iKiKVLj/BOyLf3jlGJ9LTcf z1UYSlwmSRpL0ZvbWPBbMj7fEvVG7CCZuKJQIRWSIo7LU04nNZdW9xNLAUTgoJUEH7yg 4qZGNek55Y+XnGeDW0zY3+6UhzlxpT7MLuu6dIZp0oOydmqJwTRxu/EEMw1M3shdhxve HsGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si19714509pgc.137.2019.02.28.21.39.51; Thu, 28 Feb 2019 21:40:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730630AbfCAFiM (ORCPT + 99 others); Fri, 1 Mar 2019 00:38:12 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42690 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728050AbfCAFiJ (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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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