Lines Matching refs:dev
50 static void mux_chip_release(struct device *dev)
52 struct mux_chip *mux_chip = to_mux_chip(dev);
65 * @dev: The parent device implementing the mux interface.
79 struct mux_chip *mux_chip_alloc(struct device *dev,
85 if (WARN_ON(!dev || !controllers))
95 mux_chip->dev.class = &mux_class;
96 mux_chip->dev.type = &mux_type;
97 mux_chip->dev.parent = dev;
98 mux_chip->dev.of_node = dev->of_node;
99 dev_set_drvdata(&mux_chip->dev, mux_chip);
109 dev_set_name(&mux_chip->dev, "muxchip%d", mux_chip->id);
121 device_initialize(&mux_chip->dev);
160 dev_err(&mux_chip->dev, "unable to set idle state\n");
165 ret = device_add(&mux_chip->dev);
167 dev_err(&mux_chip->dev,
183 device_del(&mux_chip->dev);
198 put_device(&mux_chip->dev);
202 static void devm_mux_chip_release(struct device *dev, void *res)
211 * @dev: The parent device implementing the mux interface.
219 struct mux_chip *devm_mux_chip_alloc(struct device *dev,
229 mux_chip = mux_chip_alloc(dev, controllers, sizeof_priv);
236 devres_add(dev, ptr);
242 static void devm_mux_chip_reg_release(struct device *dev, void *res)
251 * @dev: The parent device implementing the mux interface.
258 int devm_mux_chip_register(struct device *dev,
275 devres_add(dev, ptr);
408 /* Note this function returns a reference to the mux_chip dev. */
411 struct device *dev;
413 dev = class_find_device_by_of_node(&mux_class, np);
415 return dev ? to_mux_chip(dev) : NULL;
420 * @dev: The device that needs a mux-control.
425 struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
427 struct device_node *np = dev->of_node;
438 dev_err(dev, "mux controller '%s' not found\n",
448 dev_err(dev, "%pOF: failed to get mux-control %s(%i)\n",
460 dev_err(dev, "%pOF: wrong #mux-control-cells for %pOF\n",
462 put_device(&mux_chip->dev);
471 dev_err(dev, "%pOF: bad mux controller %u specified in %pOF\n",
473 put_device(&mux_chip->dev);
489 put_device(&mux->chip->dev);
493 static void devm_mux_control_release(struct device *dev, void *res)
503 * @dev: The device that needs a mux-control.
508 struct mux_control *devm_mux_control_get(struct device *dev,
517 mux = mux_control_get(dev, mux_name);
524 devres_add(dev, ptr);