Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7012567imu; Mon, 3 Dec 2018 06:27:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wzqg94Sk/L49aGwrgc1KHsHQcMCKltQT0wkDMCQrcB6K24pB3AQe8TRfwFryoduByfUL7C X-Received: by 2002:aa7:8758:: with SMTP id g24mr15750267pfo.250.1543847255877; Mon, 03 Dec 2018 06:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543847255; cv=none; d=google.com; s=arc-20160816; b=hLk9XEepclzlZhtLsPj7mMkmh8bvfKjODyvusacXRR102HT8AIi+ZggLLdHIRDYQAS xIY8rsxnoiEB4M4Krr1E/WcpuV9Rz1aWIzIJY5OuFmSXiYjR3tFMiiZJs8paEsEQHwro bhUJa6cwb6K7QM+BoJpy/zL16nU9vAohch6RO4gvlu3inQfoNfxruFLaIug53ioAwHNB ZuoJBZvE7UsN63Gq5ds5Uw48jdyPtot/b6OyGHbE+eApqTZgQt6hy3XAUzZjpU9BpuCd W4YPS7UaMBvhgqg/6qUp6bgQFYUbWwYjVyzftNtEaGTN663oNh+fFqMzCvvHMSjNt/93 1EUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=2WLebY7xqUbwIPvtMqD+4HTo6gWucwdphTz+WLkITYg=; b=bIemriiemhMACzIEiGLsq0Z41Ff38qUGA5waSfV4GOTADCAT+EMN/yMvrd9ug1JjpN g+KXidQqgeVoIlqAl2cMPmlsyf5EMcWWgqKK77jPKb42V11Anpl/+d6qHI4khCAb62zo dprfukHV629Hb0fynylLdFLAh10gRYJJaAVBJGYNn8V3XMGcLgxgHZSARymFBLhPLD0r GzQfVO37uthRBW8MbKKM3JaYWu427CzUOOK5KdaOgIgel8ORSAoufu/ePlSmFxQl6fLi a7Ch7CbhcsvBcUbAti67OPlIpIftWhZIf0PB4pCLsxGAke4sBDizVcIiq7GSgKNdCbG2 5x7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fEfNJo8X; 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 d189si13282413pfa.70.2018.12.03.06.27.20; Mon, 03 Dec 2018 06:27:35 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fEfNJo8X; 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 S1726623AbeLCO1z (ORCPT + 99 others); Mon, 3 Dec 2018 09:27:55 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44700 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbeLCO1y (ORCPT ); Mon, 3 Dec 2018 09:27:54 -0500 Received: by mail-pl1-f195.google.com with SMTP id k8so6542033pls.11; Mon, 03 Dec 2018 06:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2WLebY7xqUbwIPvtMqD+4HTo6gWucwdphTz+WLkITYg=; b=fEfNJo8XL8mYdFaEm4rMq2DcyclTdnjEZRHfahNQ8ciGCc27e8Pj+SXnAWw2ZGcQA0 qryZ1N/SzcZ1zW+Ll4iEoBS/izaHI53k5o1//2TwjaeHsNEUeCVip9xks0gLKxQiaaTF 65mdzmFm6wDnDpfuQnQxlQVMUPIdF6J45eIv3xu3RnQqPD75OfxoymctHFq8XoQrnUpO BUX2lJFkFz7pJEhuZRcVuDMurHYbH9St+IAEWjRIb2+bog9NajoBL1NmoJQq/d013859 Hozaqqqqd/aPONTpgJZtcKrbtQ4GPRzPTv+g2YzWRuPQEnr/WnOn7Z7ctBFz+iYWrGBR EPVA== 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; bh=2WLebY7xqUbwIPvtMqD+4HTo6gWucwdphTz+WLkITYg=; b=KQlk0J6aVcuJbN5dSg04UcVIDlHUAGpnXEpBdlVz3EYWRNYwuoxhBdDbcgQh1Aa5Ng MCbrSJsog4uSmFEG3JPEXkPJWgZRZl+j4bxZvLo9iWIqpXEh1r9CAuREHTLiJ6RrGDQn N7fsz/1eL/B8SaU0xVLku3jpId5wWcuZrGrYP/1FXALjHB3HmDTPWIfMDXalIq3hOvc6 97ouiSUxwSooj3ixjbm2ZTpkhw9VRbnhRsT38zDlEeabSzsq0jhY9XyGoelwEZKeX/bC MBNKUTRBSQ0SqQl5YCOXSs6GSo1nxNuAXQtOX4m1nI2Et5rNXy+lKkMxyZ9eXI0y9Qd1 FeMA== X-Gm-Message-State: AA+aEWZxq/nkIyVn7tGbFBExQzKIR4cdVIdqr3SVJbu1lZ+hd7kPMuM5 +X8ytc4pGXoCy5+yiFsiQkI= X-Received: by 2002:a17:902:981:: with SMTP id 1mr15671883pln.142.1543847200885; Mon, 03 Dec 2018 06:26:40 -0800 (PST) Received: from localhost (68.168.130.77.16clouds.com. [68.168.130.77]) by smtp.gmail.com with ESMTPSA id h15sm19720294pgl.43.2018.12.03.06.26.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Dec 2018 06:26:40 -0800 (PST) From: Yangtao Li To: davem@davemloft.net, stefan.wahren@i2se.com, joe@perches.com, michael.heimpold@i2se.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] net: qca_spi: convert to DEFINE_SHOW_ATTRIBUTE Date: Mon, 3 Dec 2018 09:26:38 -0500 Message-Id: <20181203142638.13178-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li --- drivers/net/ethernet/qualcomm/qca_debug.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index a9f1bc013364..264ddc0159ec 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -125,19 +125,7 @@ qcaspi_info_show(struct seq_file *s, void *what) return 0; } - -static int -qcaspi_info_open(struct inode *inode, struct file *file) -{ - return single_open(file, qcaspi_info_show, inode->i_private); -} - -static const struct file_operations qcaspi_info_ops = { - .open = qcaspi_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(qcaspi_info); void qcaspi_init_device_debugfs(struct qcaspi *qca) @@ -153,7 +141,7 @@ qcaspi_init_device_debugfs(struct qcaspi *qca) return; } debugfs_create_file("info", S_IFREG | 0444, device_root, qca, - &qcaspi_info_ops); + &qcaspi_info_fops); } void -- 2.17.0