cregit-Linux how code gets into the kernel

Release 4.11 arch/arm/mach-integrator/lm.c

/*
 *  linux/arch/arm/mach-integrator/lm.c
 *
 *  Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
 *
 * 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.
 */
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/slab.h>

#include "lm.h"


#define to_lm_device(d)	container_of(d, struct lm_device, dev)

#define to_lm_driver(d)	container_of(d, struct lm_driver, drv)


static int lm_match(struct device *dev, struct device_driver *drv) { return 1; }

Contributors

PersonTokensPropCommitsCommitProp
Russell King19100.00%1100.00%
Total19100.00%1100.00%


static int lm_bus_probe(struct device *dev) { struct lm_device *lmdev = to_lm_device(dev); struct lm_driver *lmdrv = to_lm_driver(dev->driver); return lmdrv->probe(lmdev); }

Contributors

PersonTokensPropCommitsCommitProp
Russell King41100.00%1100.00%
Total41100.00%1100.00%


static int lm_bus_remove(struct device *dev) { struct lm_device *lmdev = to_lm_device(dev); struct lm_driver *lmdrv = to_lm_driver(dev->driver); if (lmdrv->remove) lmdrv->remove(lmdev); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Russell King49100.00%2100.00%
Total49100.00%2100.00%

static struct bus_type lm_bustype = { .name = "logicmodule", .match = lm_match, .probe = lm_bus_probe, .remove = lm_bus_remove, // .suspend = lm_bus_suspend, // .resume = lm_bus_resume, };
static int __init lm_init(void) { return bus_register(&lm_bustype); }

Contributors

PersonTokensPropCommitsCommitProp
Russell King16100.00%1100.00%
Total16100.00%1100.00%

postcore_initcall(lm_init);
int lm_driver_register(struct lm_driver *drv) { drv->drv.bus = &lm_bustype; return driver_register(&drv->drv); }

Contributors

PersonTokensPropCommitsCommitProp
Russell King28100.00%1100.00%
Total28100.00%1100.00%


void lm_driver_unregister(struct lm_driver *drv) { driver_unregister(&drv->drv); }

Contributors

PersonTokensPropCommitsCommitProp
Russell King18100.00%1100.00%
Total18100.00%1100.00%


static void lm_device_release(struct device *dev) { struct lm_device *d = to_lm_device(dev); kfree(d); }

Contributors

PersonTokensPropCommitsCommitProp
Russell King26100.00%1100.00%
Total26100.00%1100.00%


int lm_device_register(struct lm_device *dev) { int ret; dev->dev.release = lm_device_release; dev->dev.bus = &lm_bustype; ret = dev_set_name(&dev->dev, "lm%d", dev->id); if (ret) return ret; dev->resource.name = dev_name(&dev->dev); ret = request_resource(&iomem_resource, &dev->resource); if (ret == 0) { ret = device_register(&dev->dev); if (ret) release_resource(&dev->resource); } return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Russell King9886.73%150.00%
Kay Sievers1513.27%150.00%
Total113100.00%2100.00%

EXPORT_SYMBOL(lm_driver_register); EXPORT_SYMBOL(lm_driver_unregister);

Overall Contributors

PersonTokensPropCommitsCommitProp
Russell King36695.06%350.00%
Kay Sievers153.90%116.67%
Tim Schmielau30.78%116.67%
Linus Walleij10.26%116.67%
Total385100.00%6100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.