spi: dw-pci: move info message at the end of probe
PATCH 1/4 spi: dw-pci: move info message at the end of probe
Let's print info message when controller is found and properly initialized.
--- drivers/spi/spi-dw-pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-dw-pci.c +3 -3
@@ -40,9 +40,6 @@ static int spi_pci_probe(struct pci_dev *pdev,int pci_bar =0 ;int ret; -dev_info (&pdev->dev,"found PCI SPI controller(ID: %04x:%04x)\n" , - pdev->vendor, pdev->device); - ret =pcim_enable_device (pdev);if (ret)return ret;
@@ -85,6 +82,9 @@ static int spi_pci_probe(struct pci_dev *pdev,/* PCI hook and SPI hook use the same drv data */ pci_set_drvdata (pdev, dwpci); +dev_info (&pdev->dev,"found PCI SPI controller(ID: %04x:%04x)\n" , + pdev->vendor, pdev->device); +return 0 ; }
Signature · 6 lines
2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1409210464-29039-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]
PATCH 2/4 spi: dw-pci: apply pci_bar and re-use pci_name
Nevertheless pci_bar is 0 let's explicitly use it when map IO regions. While here, use pci_name instead of dev_name.
--- drivers/spi/spi-dw-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-dw-pci.c +1 -1
@@ -55,7 +55,7 @@ static int spi_pci_probe(struct pci_dev *pdev,/* Get basic io resource and map it */ dws->paddr =pci_resource_start (pdev, pci_bar); - ret =pcim_iomap_regions (pdev,1 ,dev_name (&pdev->dev)); + ret =pcim_iomap_regions (pdev,1 << pci_bar,pci_name (pdev));if (ret)return ret;
Signature · 6 lines
2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/4 spi: dw-pci: convert to use dev_pm_ops
In reply to a message not in the archiveConvert system PM callbacks to use dev_pm_ops. In addition remove the PCI calls related to a power state since the bus code cares about this already.
--- drivers/spi/spi-dw-pci.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-)
drivers/spi/spi-dw-pci.c +11 -22
@@ -95,38 +95,26 @@ static void spi_pci_remove(struct pci_dev *pdev)dw_spi_remove_host (&dwpci->dws); } -#ifdef CONFIG_PM -static int spi_suspend (struct pci_dev *pdev,pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int spi_suspend (struct device *dev) { +struct pci_dev *pdev =to_pci_dev (dev);struct dw_spi_pci *dwpci =pci_get_drvdata (pdev); -int ret; - ret =dw_spi_suspend_host (&dwpci->dws); -if (ret) -return ret; -pci_save_state (pdev); -pci_disable_device (pdev); -pci_set_power_state (pdev,pci_choose_state (pdev, state)); -return ret; +return dw_spi_suspend_host (&dwpci->dws); } -static int spi_resume (struct pci_dev *pdev) +static int spi_resume (struct device *dev) { +struct pci_dev *pdev =to_pci_dev (dev);struct dw_spi_pci *dwpci =pci_get_drvdata (pdev); -int ret; -pci_set_power_state (pdev,PCI_D0 ); -pci_restore_state (pdev); - ret =pci_enable_device (pdev); -if (ret) -return ret;return dw_spi_resume_host (&dwpci->dws); } -#else -#define spi_suspend NULL -#define spi_resume NULL#endif +static SIMPLE_DEV_PM_OPS(dw_spi_pm_ops, spi_suspend, spi_resume); +static const struct pci_device_id pci_ids[] = {/* Intel MID platform SPI controller 0 */ {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x0800 ) },
@@ -138,8 +126,9 @@ static struct pci_driver dw_spi_driver = { .id_table = pci_ids, .probe = spi_pci_probe, .remove = spi_pci_remove, - .suspend = spi_suspend, - .resume = spi_resume, + .driver = { + .pm = &dw_spi_pm_ops, + }, };module_pci_driver (dw_spi_driver);
Signature · 6 lines
2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 spi: dw-pci: remove FSF address and update copyright
In reply to a message not in the archiveThe FSF address is subject to change, thus remove it from the file. While here, update a copyright line.
--- drivers/spi/spi-dw-pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/spi/spi-dw-pci.c +1 -5
@@ -1,7 +1,7 @@/* * PCI interface driver for DW SPI Core * -* Copyright (c) 2009, Intel Corporation. +* Copyright (c) 2009, 2014 Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
@@ -11,10 +11,6 @@* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. -* -* You should have received a copy of the GNU General Public License along -* with this program; if not, write to the Free Software Foundation, -* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ #include <linux/interrupt.h>
Signature · 6 lines
2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html