for (i = 0; i < dev->num_resources; i++) {
struct resource *r = &dev->resource[i];
- if ((resource_type(r) & (IORESOURCE_MEM|IORESOURCE_IO)) && num-- == 0)
+ if ((resource_type(r) & (IORESOURCE_MEM | IORESOURCE_IO)) && num-- == 0)
return r;
}
return NULL;
*/
void __iomem *
devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
- unsigned int index, struct resource **res)
+ unsigned int index, struct resource **res)
{
struct resource *r;
* @num: interrupt number index
* @affinity: optional cpumask pointer to get the affinity of a per-cpu interrupt
*
- * Gets an interupt for a platform device. Device drivers should check the
+ * Gets an interrupt for a platform device. Device drivers should check the
* return value for errors so as to not pass a negative integer value to
* the request_irq() APIs. Optional affinity information is provided in the
* affinity pointer if available, and NULL otherwise.
*
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/
-struct platform_device *platform_device_register_full(
- const struct platform_device_info *pdevinfo)
+struct platform_device *platform_device_register_full(const struct platform_device_info *pdevinfo)
{
int ret;
struct platform_device *pdev;
pdev->dev.coherent_dma_mask = pdevinfo->dma_mask;
}
- ret = platform_device_add_resources(pdev,
- pdevinfo->res, pdevinfo->num_res);
+ ret = platform_device_add_resources(pdev, pdevinfo->res, pdevinfo->num_res);
if (ret)
goto err;
- ret = platform_device_add_data(pdev,
- pdevinfo->data, pdevinfo->size_data);
+ ret = platform_device_add_data(pdev, pdevinfo->data, pdevinfo->size_data);
if (ret)
goto err;
* @drv: platform driver structure
* @owner: owning module/driver
*/
-int __platform_driver_register(struct platform_driver *drv,
- struct module *owner)
+int __platform_driver_register(struct platform_driver *drv, struct module *owner)
{
drv->driver.owner = owner;
drv->driver.bus = &platform_bus_type;
* a negative error code and with the driver not registered.
*/
int __init_or_module __platform_driver_probe(struct platform_driver *drv,
- int (*probe)(struct platform_device *), struct module *module)
+ int (*probe)(struct platform_device *),
+ struct module *module)
{
int retval;
if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) {
pr_err("%s: drivers registered with %s can not be probed asynchronously\n",
- drv->driver.name, __func__);
+ drv->driver.name, __func__);
return -EINVAL;
}
*
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/
-struct platform_device * __init_or_module __platform_create_bundle(
- struct platform_driver *driver,
- int (*probe)(struct platform_device *),
- struct resource *res, unsigned int n_res,
- const void *data, size_t size, struct module *module)
+struct platform_device * __init_or_module
+__platform_create_bundle(struct platform_driver *driver,
+ int (*probe)(struct platform_device *),
+ struct resource *res, unsigned int n_res,
+ const void *data, size_t size, struct module *module)
{
struct platform_device *pdev;
int error;
}
EXPORT_SYMBOL_GPL(platform_unregister_drivers);
-static const struct platform_device_id *platform_match_id(
- const struct platform_device_id *id,
- struct platform_device *pdev)
+static const struct platform_device_id *
+platform_match_id(const struct platform_device_id *id, struct platform_device *pdev)
{
while (id->name[0]) {
if (strcmp(pdev->name, id->name) == 0) {
NULL,
};
-static umode_t platform_dev_attrs_visible(struct kobject *kobj, struct attribute *a,
- int n)
+static umode_t platform_dev_attrs_visible(struct kobject *kobj,
+ struct attribute *a, int n)
{
struct device *dev = container_of(kobj, typeof(*dev), kobj);
- if (a == &dev_attr_numa_node.attr &&
- dev_to_node(dev) == NUMA_NO_NODE)
+ if (a == &dev_attr_numa_node.attr && dev_to_node(dev) == NUMA_NO_NODE)
return 0;
return a->mode;
};
__ATTRIBUTE_GROUPS(platform_dev);
-
/**
* platform_match - bind platform device to platform driver.
* @dev: device.
if (rc != -ENODEV)
return rc;
- add_uevent_var(env, "MODALIAS=%s%s", PLATFORM_MODULE_PREFIX,
- pdev->name);
+ add_uevent_var(env, "MODALIAS=%s%s", PLATFORM_MODULE_PREFIX, pdev->name);
return 0;
}