Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3373488imm; Tue, 29 May 2018 06:14:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIXMlrYCthz1WZf0HyoqKjdY2y0Hc3s0QDqvAtc+3rOl48ZeM9qSmou2mvlECPVfXC44eu3 X-Received: by 2002:a62:59d0:: with SMTP id k77-v6mr13210030pfj.4.1527599663795; Tue, 29 May 2018 06:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527599663; cv=none; d=google.com; s=arc-20160816; b=BnmVLoFPD4Qld/AjfqGP6ShfXr246KXNgu0XSeFBdxbr24E56VKsI8HMUVxCv3DnVB +rnyOINBulICKxpqkyCxEo/arzoQPeKW6GLQNZH0fPTL7H8Kudv4yL2COR9g33UhCPIr RXbmYV/zHVTAzjTEnI+VkuMCqzpOGV7UOkou3izKEUbjDoai1cVCRm/E8Gf9Kyd9BuS2 c9Yv/4h66kTi6tMSaTEbaT1B61DRKevsMGiy+17DjmJcbwH9nV1syKC+7vgoiFefAZSd rzzHJi508du83r+JEtIeujShnseRCJ/ZvWg55EohuDiFaZf7c9TOihXLkIsh/jBHs3gG UW2w== 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:dkim-signature:arc-authentication-results; bh=nSaQnHOfTjkkuEongnR7VKFuaN6bUa9r8M6oyKbDjv4=; b=sXSKmt/AfVas9Bsdd7XBHhs/BhLaW/sMaFFVfAdgV5xfWR8k8MXwDhfKHD1Y1T9Ybq oj1zpQHSUKDIx7b25xNvUJL459+vbqMcemMHjw8lh6RBNMyBKVVBou+JGCCgx/vKQavD /5Cn9VtrvQw/sqS6+xQ6oMj88pWtreALDRCorqBi8fWgMhjE7z6yJKViHAp72hVlrIbr Qz2s7nENlvbB3xe6OV6CLpKOS9lX7CRNjsjek6+oZKRBKIobM6IWsbD6L3j9akLspqhO CXFz7QPHenCt5YpwdbxwyJAxKEb4cbs7c6S7Rnp2iBS43AmQaonc0JkRAhbU+iok4EUK IbNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UnIsRgOT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11-v6si25476319pgu.459.2018.05.29.06.14.09; Tue, 29 May 2018 06:14:23 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UnIsRgOT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934637AbeE2NK7 (ORCPT + 99 others); Tue, 29 May 2018 09:10:59 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:51732 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934083AbeE2NKt (ORCPT ); Tue, 29 May 2018 09:10:49 -0400 Received: by mail-wm0-f52.google.com with SMTP id r15-v6so12825960wmc.1; Tue, 29 May 2018 06:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nSaQnHOfTjkkuEongnR7VKFuaN6bUa9r8M6oyKbDjv4=; b=UnIsRgOTI5VoTtY+N19A/FvzE283RfuiYDDebFqPynenZZ7I0gvcLFBRleAENT3OqP aX0yvfM1c7c2uqzqGDChZzM/f3xVZzdGrVYqbYvZmLp9eDcVT9qf1ccz9dt0XdFH6q3e 0kqiixKS0akJOSnLLPvLaLC71/kA35UH8AsWR4PgmSP8Ln6Jji9pj7HSp8mdEmvZcuOI ADWfHhfi++cyOYnsxCZQv9iHp7UqxzGpPousUlfn7Ez0KmkiTo+PGbFzwfX+19vyVWLb IpIBe3MUNWmxcqnTpSULSey1UF+Uiclr2U/fLWiI+CnFd58StHuGP32erJE3qLCQ8PyD e8eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nSaQnHOfTjkkuEongnR7VKFuaN6bUa9r8M6oyKbDjv4=; b=Nvc/RTluuQCuzk3NHc0ajUG6tCsHLhwlINZ82823gqfUPHtyr+xvzO1Zz3Uomd52wq +NFSKEMIV0A9kH5EnR2Ar78t4X0zt0G6HfSxXgS+HI74swUvbNpNibtVGKlwgvy3IrWY isOzD0jM9u2Ie+9VegnTYOKIIOaGn6qFi+M8tJJf5TY41irbjw6lhafiZO2vNHEAmo6h LrQtKXcwp0rN98eDNALvP3dvtE1QRqkYizD/RSM05qJJACTDsstnJW0nE4dSaHmnDiVE mZx0Cw9+srqQP494iwJWgIT9pzJe+Rd2mArFg4dpPvVadOqj3Nd3ZYF3Odnx0zT33Xt+ ROYw== X-Gm-Message-State: ALKqPwdRqWwoosaZXtgaEt7yCzH6WNww+RIdtnJ/KPKfWda7+pjCYtAG pPq4tI2GGPeK17DHrETdt5y+leo9 X-Received: by 2002:a50:f552:: with SMTP id w18-v6mr9485093edm.230.1527599447860; Tue, 29 May 2018 06:10:47 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id c15-v6sm17443220edr.78.2018.05.29.06.10.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 06:10:46 -0700 (PDT) From: Ricardo Ribalda Delgado To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Ricardo Ribalda Delgado , Greg Kroah-Hartman , Philippe Ombredanne , Rob Herring , Johan Hovold Subject: [PATCH 10/19] file2alias: Support for serdev devices Date: Tue, 29 May 2018 15:10:05 +0200 Message-Id: <20180529131014.18641-11-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529131014.18641-1-ricardo.ribalda@gmail.com> References: <20180529131014.18641-1-ricardo.ribalda@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch allows file2alias to generate the proper module headers to support serdev modalias drivers. Eg: root@qt5022:~# modinfo serdev:ttydev | grep alias alias: serdev:ttydev_serdev alias: serdev:ttydev root@qt5022:~# cat /lib/modules/4.16.0-qtec-standard/modules.alias | grep serdev alias serdev:ttydev_serdev serdev_ttydev alias serdev:ttydev serdev_ttydev Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Rob Herring Cc: Johan Hovold Signed-off-by: Ricardo Ribalda Delgado --- scripts/mod/devicetable-offsets.c | 3 +++ scripts/mod/file2alias.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index 9fad6afe4c41..6082c41b7ad7 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -142,6 +142,9 @@ int main(void) DEVID(i2c_device_id); DEVID_FIELD(i2c_device_id, name); + DEVID(serdev_device_id); + DEVID_FIELD(serdev_device_id, name); + DEVID(spi_device_id); DEVID_FIELD(spi_device_id, name); diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index b9beeaa4695b..dce6df3a159a 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -955,6 +955,17 @@ static int do_i2c_entry(const char *filename, void *symval, } ADD_TO_DEVTABLE("i2c", i2c_device_id, do_i2c_entry); +/* Looks like: serdev:S */ +static int do_serdev_entry(const char *filename, void *symval, + char *alias) +{ + DEF_FIELD_ADDR(symval, serdev_device_id, name); + sprintf(alias, SERDEV_MODULE_PREFIX "%s", *name); + + return 1; +} +ADD_TO_DEVTABLE("serdev", serdev_device_id, do_serdev_entry); + /* Looks like: spi:S */ static int do_spi_entry(const char *filename, void *symval, char *alias) -- 2.17.0