static void vexpress_reset_do(struct device *dev, const char *what) { int err = -ENOENT; struct vexpress_config_func *func = vexpress_config_func_get_by_dev(dev); if (func) { unsigned long timeout; err = vexpress_config_write(func, 0, 0); timeout = jiffies + HZ; while (time_before(jiffies, timeout)) cpu_relax(); } dev_emerg(dev, "Unable to %s (%d)\n", what, err); }
struct clk * __init vexpress_osc_setup(struct device *dev) { struct clk_init_data init; struct vexpress_osc *osc = kzalloc(sizeof(*osc), GFP_KERNEL); if (!osc) return NULL; osc->func = vexpress_config_func_get_by_dev(dev); if (!osc->func) { kfree(osc); return NULL; } init.name = dev_name(dev); init.ops = &vexpress_osc_ops; init.flags = CLK_IS_ROOT; init.num_parents = 0; osc->hw.init = &init; return clk_register(NULL, &osc->hw); }