From patchwork Mon Oct 17 17:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1557716wrs; Mon, 17 Oct 2022 10:16:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM686TmflsvCUmS0XVCXp4TUWMUSiYIPSXDnK6Dzob0KWHAv6+VFpPZMCXioIwnjGPgG19g4 X-Received: by 2002:a17:902:bd98:b0:182:631b:7dd5 with SMTP id q24-20020a170902bd9800b00182631b7dd5mr12712861pls.165.1666026994925; Mon, 17 Oct 2022 10:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026994; cv=none; d=google.com; s=arc-20160816; b=ULunJP4tlhvTGuYLB40iZUurrYVQCRyzLlGELanVLGUrIqQVBjqelNg4yhATIUmEHA I1c3dnuvzt11gkDdHvppG18Pme6yJF6rEWYotyiA5AyXL6hthWTCRhyCv2yunYp3Z5Df dgSLpV8ABHWRYtDLF12PacFL9Ecg3iUX23YivnKfRLhDcy+F3x1CMmdhYRLd0M+2DsZC vuZnmXjg7jokrQPT0waQPTwc7S3iFze7TjoT6fjy8Ad7gsMooRVWeRYfCSTsRCBVSimg hgx4mgOGuPPqXsCJBQG1A13rBuHO6ouN53IDkxDRurBzgwWvYFHsjrdjPvuoX2lVukvi DHjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kj3flBS8jRJCDm/6iMh6Wugi6AtDY8VFGPPFxUuNgyo=; b=qtf5pwCAebMEsdyL5nhpjouaFlCDL4a4Zfs5jcTlI9OodGbfJlcu5z8EZoWo2aOg3F kUX8FOc0u7vjvpcJ6i399juGHNKPgY61sxLIiswzK/J6+Wv3uu2dqnbq+Brcy9JXyeq9 ZbA/XJj4XEl4nUdNv2DIhp8O35YVMJi6Z/SHSm80yTLiZX4GFk1Xk0tjRGEPuP1sWBFr 2Q40izU2tj/Nfx+QI/mTH4aeDHUvIrfUbZpAoDc89Al1lbl3NfPsphNysbaU5mP8NVnI j3lOPPg0Bgs1kpjOy7u/wHhw2Qy2u8mOAH6ahTdFsN6iR/YqsZPd0MFGeLDhabaAjYyv 2G5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N0VcCb31; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a630311000000b0043090081d69si11774385pgd.82.2022.10.17.10.16.21; Mon, 17 Oct 2022 10:16:34 -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=N0VcCb31; 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 S229925AbiJQRMp (ORCPT + 99 others); Mon, 17 Oct 2022 13:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbiJQRMc (ORCPT ); Mon, 17 Oct 2022 13:12:32 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1916C12C; Mon, 17 Oct 2022 10:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666026752; x=1697562752; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ADkxelsrZAI/xTgM7q/ZgWlu+FGtliIPT22gKCweeCM=; b=N0VcCb31/R50pCWXM8xRpfSFtwK/9Zccn4bIG8qvMP1cn/DnZKhsVQ6x AQdZenamRL96Jn6zMYSX6Mc/dlK1xkNttPOMXxJLeF3F0lXlzDrbhkXqh LrK6IiHJfzaR4aOrF+kaHtt260jcv3E3KTCgGSn/7DTPxBFRQciJbTZPR 92n/fLGCYGYG00N4epWHHgrz0DEdL8v1/ToaNsNbqhOIsi9qVfBsRqNwa caRH2azvxu/hwPNgpkCWfR0ugtbs0bRI1iPr8e00YQ5EWWFx9PVPRPqJS bRXnBk8JiM3HeNpQNVhiW7QGNivKieGwAbJJuaSIPNTUh5Eo33DhbMxQv g==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="305849468" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="305849468" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2022 10:12:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="957417124" X-IronPort-AV: E=Sophos;i="5.95,192,1661842800"; d="scan'208";a="957417124" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2022 10:12:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3123D26D; Mon, 17 Oct 2022 20:12:51 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Subject: [PATCH v1 5/6] spi: pxa2xx: Move OF and ACPI ID tables closer to their user Date: Mon, 17 Oct 2022 20:12:42 +0300 Message-Id: <20221017171243.57078-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> References: <20221017171243.57078-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746955922168512085?= X-GMAIL-MSGID: =?utf-8?q?1746955922168512085?= There is no code that uses ID tables directly, except the struct device_driver at the end of the file. Hence, move tables closer to its user. It's always possible to access them via pointer to a platform device. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 31927493eeb0..76046612466d 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1321,25 +1321,6 @@ static void cleanup(struct spi_device *spi) kfree(chip); } -#ifdef CONFIG_ACPI -static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { - { "INT33C0" }, - { "INT33C1" }, - { "INT3430" }, - { "INT3431" }, - { "80860F0E" }, - { "8086228E" }, - { }, -}; -MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); -#endif - -static const struct of_device_id pxa2xx_spi_of_match[] = { - { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, - {}, -}; -MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); - static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param) { return param == chan->device->dev; @@ -1759,6 +1740,25 @@ static const struct dev_pm_ops pxa2xx_spi_pm_ops = { pxa2xx_spi_runtime_resume, NULL) }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id pxa2xx_spi_acpi_match[] = { + { "80860F0E" }, + { "8086228E" }, + { "INT33C0" }, + { "INT33C1" }, + { "INT3430" }, + { "INT3431" }, + {} +}; +MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match); +#endif + +static const struct of_device_id pxa2xx_spi_of_match[] = { + { .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP }, + {} +}; +MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match); + static struct platform_driver driver = { .driver = { .name = "pxa2xx-spi",