Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2094076rwe; Fri, 2 Sep 2022 08:24:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR4/bh6TLcqF4nJLnfttMwULxRH5QwA2/6rbYlVWgqEgBIo2uDxNCtdAevGez7ypWcBdkIlY X-Received: by 2002:a05:6402:379:b0:448:de41:2c0c with SMTP id s25-20020a056402037900b00448de412c0cmr14335383edw.290.1662132252993; Fri, 02 Sep 2022 08:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662132252; cv=none; d=google.com; s=arc-20160816; b=OwrR7j7XdE+myZtWwGRU6eA+Z98yyYPggn4Ipw8/0dG0ALDL33G3Uv1PimIcwC+r+B gMo9/54YlyrPOxMyFxGhJwlP9dlrYI6YJAFVO4Ekmz2p9uYoNDi8qFzwwgesxf1zPVHq s4HR2hhXc7tOLFs/4bM+zCdgjjB4Ov+12/OV+FZ6WVu+6Jgqyut0vihKWbgk+n2goWSq j/5FXR64PCN0hOcz/zi+gLmjXB6F9E8+dvYzRT0cqn8R5JIJxrjZXCyfFuYiJfjRRaNp Lk5ijLtkV8Saxj6sovGH90dhHz4t/i/XdFPFzemm+WTzHjG3XUjjSvIlgVdA3jZF5vLZ oglA== 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=DzLSCD+A0rN0LaUcy1OFgf7UuVtLTOBbSDBqiHG8oLE=; b=PRVpxH03C+2S3Pg0aT56VvC1ezwMFt3183XR5x8XXI+elcg8mJXKoRYmBtTQRD6OK3 Bk3sI9Yz1DBwfNlksbLzSrKkk7mbdsI+fOxxzvdC6RxE7SdZqzZkkvVrdCHSYy31rZRP V21vIMkDWWsABPSiqe/MkFd71s10YXNuLJl7FLFqTTM1UQAm+3OKCQnMMFj81PuVcgdU +f/dVxOmnho1wwQror+OrahPhUNT2klrOnpl3Fox9lHWeb3C0JH775+FnQbp88c7mvab rCOmpYwcnuTxmwnhBR3TRCuLwSZ0Mj/xhPSuZ2cl58R/HZDzhTYzieTS0iXxepyEWkbR 8k3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0uAPsfVL; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a056402090b00b0044884549409si2453860edz.356.2022.09.02.08.23.45; Fri, 02 Sep 2022 08:24:12 -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=@linuxfoundation.org header.s=korg header.b=0uAPsfVL; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236256AbiIBPUi (ORCPT + 99 others); Fri, 2 Sep 2022 11:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236234AbiIBPUK (ORCPT ); Fri, 2 Sep 2022 11:20:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D06110D92; Fri, 2 Sep 2022 07:52:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E1D6B82C4F; Fri, 2 Sep 2022 14:52:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB30C433D7; Fri, 2 Sep 2022 14:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662130375; bh=2nsqhytIadgt0yVsKmvIq8R/PDqbSS7Zny3Nh5gwWMQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0uAPsfVL/EPbSnsrzxjIoo9Vj03dtq8el44F980fwZklNXH9iaGfEh96nTFOW3+KB W/xjrZuVANL2pJXr0SdhyAEDicdaJ5mNzACUmRvoR6Au2fcR0GVh3ZRRyJr339FKty FW7QnIvk75oZqiZmwynvXq6r5al/oB61Jy3rLl4M= Date: Fri, 2 Sep 2022 16:52:52 +0200 From: Greg KH To: Jiasheng Jiang Cc: johan@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Re: [PATCH v3] USB: serial: ftdi_sio: Convert to use dev_groups Message-ID: References: <20220902143346.4120012-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902143346.4120012-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On Fri, Sep 02, 2022 at 10:33:46PM +0800, Jiasheng Jiang wrote: > On Fri, Sep 02, 2022 at 05:56:13PM +0800, Greg KH wrote: > >> drivers/usb/serial/ftdi_sio.c | 101 +++++++++++++++++----------------- > >> 1 file changed, 51 insertions(+), 50 deletions(-) > >> > >> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c > >> index d5a3986dfee7..479c3a5caaf8 100644 > >> --- a/drivers/usb/serial/ftdi_sio.c > >> +++ b/drivers/usb/serial/ftdi_sio.c > >> @@ -1107,11 +1107,40 @@ static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); > >> static u32 ftdi_232bm_baud_to_divisor(int baud); > >> static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); > >> static u32 ftdi_2232h_baud_to_divisor(int baud); > >> +static umode_t ftdi_sio_attr_is_visible(struct kobject *kobj, > >> + struct attribute *attr, int idx); > >> +static ssize_t latency_timer_store(struct device *dev, > >> + struct device_attribute *attr, > >> + const char *valbuf, size_t count); > >> +static ssize_t event_char_store(struct device *dev, > >> + struct device_attribute *attr, const char *valbuf, size_t count); > >> +static ssize_t latency_timer_show(struct device *dev, > >> + struct device_attribute *attr, char *buf); > >> + > > > > Please work with the code so that you do not have to pre-define these > > functions. It should be possible. Worst case, you pre-define the > > structure for the driver, that should be it. > > Without pre-definition of the functions, compilation errors will occur, > such as 'ftdi_sio_attr_is_visible' undeclared here. > I have no idea why they are not necessary. If you move the code around that asks for those functions, you will not need to define them. > > And again, have you tested this change? > > Every time I change the code, I recomplie it and check whether there are > errors. > Are there any other tests I need to do? Yes, boot with the device and make sure that the sysfs files are still there. You do have access to one of these devices, right? They are very very common. thanks, greg k-h