mirror of
https://github.com/torvalds/linux.git
synced 2024-12-22 02:52:56 +00:00
d2912cb15b
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Intel PCH/PCU SPI flash platform driver.
|
|
*
|
|
* Copyright (C) 2016, Intel Corporation
|
|
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
*/
|
|
|
|
#include <linux/ioport.h>
|
|
#include <linux/module.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
#include "intel-spi.h"
|
|
|
|
static int intel_spi_platform_probe(struct platform_device *pdev)
|
|
{
|
|
struct intel_spi_boardinfo *info;
|
|
struct intel_spi *ispi;
|
|
struct resource *mem;
|
|
|
|
info = dev_get_platdata(&pdev->dev);
|
|
if (!info)
|
|
return -EINVAL;
|
|
|
|
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
ispi = intel_spi_probe(&pdev->dev, mem, info);
|
|
if (IS_ERR(ispi))
|
|
return PTR_ERR(ispi);
|
|
|
|
platform_set_drvdata(pdev, ispi);
|
|
return 0;
|
|
}
|
|
|
|
static int intel_spi_platform_remove(struct platform_device *pdev)
|
|
{
|
|
struct intel_spi *ispi = platform_get_drvdata(pdev);
|
|
|
|
return intel_spi_remove(ispi);
|
|
}
|
|
|
|
static struct platform_driver intel_spi_platform_driver = {
|
|
.probe = intel_spi_platform_probe,
|
|
.remove = intel_spi_platform_remove,
|
|
.driver = {
|
|
.name = "intel-spi",
|
|
},
|
|
};
|
|
|
|
module_platform_driver(intel_spi_platform_driver);
|
|
|
|
MODULE_DESCRIPTION("Intel PCH/PCU SPI flash platform driver");
|
|
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
|
|
MODULE_LICENSE("GPL v2");
|
|
MODULE_ALIAS("platform:intel-spi");
|