Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4068119rwe; Tue, 30 Aug 2022 04:11:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BD6c7xNF10sEaxF17kp2p0bRTCAMci+sSW2ZhXqdzGS+51AXbenBKUN4kejJm0relfkBK X-Received: by 2002:a63:1e5f:0:b0:419:d6bf:b9d7 with SMTP id p31-20020a631e5f000000b00419d6bfb9d7mr18078934pgm.593.1661857898557; Tue, 30 Aug 2022 04:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661857898; cv=none; d=google.com; s=arc-20160816; b=WaewFbOXJzAFIoi/86ySVrlT602XecltIZbCY6LV/CT7TRueIbAy7GkH48sB5WzJs4 Tn/lf61e0VA4QdDk6aXm4pBTKrCXrsRP5zFxXxPSzdUX00oRrzm7oOf6h9MSXXtkt8sz G+sOOdGiNxRBBE6LZ9AYn6p/FAw2aRLkIq98ehcWWXOSQlOmGXdr7lqEvS4hpDyhmxPD qOC8tcyrfjrAsCHQP0rlNpIsGe4mhVa3lKcey5pgiKbVl9hpMmurwx8hR/yd2C7K+6EB ldFmXefJDbjngr3ZX42uDbzUP6H1KeWwHkaFXTA7BF7WOd+gKHILSTFj77uuqvC4sGkK h6Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qu7tzJSoblLIiAY+pKAJm9Lko5B2R+19lDdfHb0FGz4=; b=kAJNcDbt+8vfcMX64IXg2WpSHmcYBB090ukPYUT7ZuALVPN+XYt2NI1RNfClyzuH5s C0xp3TdnUhCR8ZhAD/PNZANYIX8LKxg0G6Nww8LNApP0kITeLmB1rMqVujbNiddhgoSn jxfrpYR0hmz98XuEoHciTIN1ELqlkEveU4HJiHV2oeKtKiAKL2KYENxRpC+qTFYE0fUv s4yJC1w280UdSNTH6gwc7P9/COY0adVepvhdjCLtJWFVlSjubcDmDwlvg+YT/tf4C/aU rlFnNca6r/g6eeiSyM/NSVR41ZEjZWfIYkysqyIOeEXYDknGZvE8JyoXrR0vMKLAjDb2 yoow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hBHemhB9; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a656794000000b0042c18d28c84si1990302pgr.810.2022.08.30.04.11.27; Tue, 30 Aug 2022 04:11:38 -0700 (PDT) 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=@intel.com header.s=Intel header.b=hBHemhB9; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiH3K6C (ORCPT + 99 others); Tue, 30 Aug 2022 06:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbiH3K56 (ORCPT ); Tue, 30 Aug 2022 06:57:58 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09A99A405E; Tue, 30 Aug 2022 03:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661857075; x=1693393075; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DCdm7zO12JjMTqB/LiqCExVRxENy5N3vIqGs/oWeM0s=; b=hBHemhB9maKn67gECoKgRseGZ9A8v0QIx0QQyYW8C2eSgiyyypx0FfTa vHznQicWFh/EpzFLJcJyKRWj6vw8R24WMbU10P/ai4WKa9puBF1zK3DsE u0DNaAOtUfjw1Pqysbdlz4AnZ64HCJS/4R30dCVdvvVryv2aVuXkolH4N IjVdqaKW/7JYMjRK3zYKcnEm6Bly/M6TezbmQW6GDemqzpJ7YepjyyL3C Br1Gb+mDRgKhG+CmSVzttsCPOqlGyw+e5qQcX6QuKzTyP1cBdVOtpexak bydUgeVQZNalAagvPqUtaSaQtGwzCLfvArO1gB+YPwwmnFuuRluHGucDl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="293888381" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="293888381" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 03:57:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="753987563" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 30 Aug 2022 03:57:50 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 30 Aug 2022 13:57:49 +0300 Date: Tue, 30 Aug 2022 13:57:49 +0300 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyle Tso Subject: Re: [PATCH v1 3/4] usb: typec: tcpci_maxim: Export helper function for register reads Message-ID: References: <20220826084001.3341215-1-badhri@google.com> <20220826084001.3341215-3-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826084001.3341215-3-badhri@google.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Badhri, On Fri, Aug 26, 2022 at 01:40:00AM -0700, Badhri Jagan Sridharan wrote: > Signed-off-by: Badhri Jagan Sridharan No commit message? I guess you want to do this because you want to split the driver into several files. Please put that into your commit message. > --- > drivers/usb/typec/tcpm/tcpci_maxim.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpci_maxim.c b/drivers/usb/typec/tcpm/tcpci_maxim.c > index 4b6705f3d7b7..af3a7ecab23b 100644 > --- a/drivers/usb/typec/tcpm/tcpci_maxim.c > +++ b/drivers/usb/typec/tcpm/tcpci_maxim.c > @@ -68,25 +68,29 @@ static struct max_tcpci_chip *tdata_to_max_tcpci(struct tcpci_data *tdata) > return container_of(tdata, struct max_tcpci_chip, data); > } > > -static int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val) > +inline int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val) > { > return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u16)); > } > +EXPORT_SYMBOL_GPL(max_tcpci_read16); Hold on! You don't need to export these under any circumstance. If you want to make these inline function, move them to a header. Otherwise just make them non-static. Either way, don't export them. > -static int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val) > +inline int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val) > { > return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u16)); > } > +EXPORT_SYMBOL_GPL(max_tcpci_write16); > > -static int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val) > +inline int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val) > { > return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u8)); > } > +EXPORT_SYMBOL_GPL(max_tcpci_read8); > > -static int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val) > +inline int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val) > { > return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u8)); > } > +EXPORT_SYMBOL_GPL(max_tcpci_write8); > > static void max_tcpci_init_regs(struct max_tcpci_chip *chip) > { > -- > 2.37.2.672.g94769d06f0-goog -- heikki