for_each_source(priv, source) {
unsigned int i = to_index(priv, source);
- struct v4l2_async_subdev *asd;
+ struct max9286_asd *mas;
- asd = v4l2_async_notifier_add_fwnode_subdev(&priv->notifier,
+ mas = v4l2_async_notifier_add_fwnode_subdev(&priv->notifier,
source->fwnode,
- sizeof(struct max9286_asd));
- if (IS_ERR(asd)) {
+ struct max9286_asd);
+ if (IS_ERR(mas)) {
dev_err(dev, "Failed to add subdev for source %u: %ld",
- i, PTR_ERR(asd));
+ i, PTR_ERR(mas));
v4l2_async_notifier_cleanup(&priv->notifier);
- return PTR_ERR(asd);
+ return PTR_ERR(mas);
}
- to_max9286_asd(asd)->source = source;
+ mas->source = source;
}
priv->notifier.ops = &max9286_notify_ops;
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
&bridge->notifier,
of_fwnode_handle(ep_node),
- sizeof(*asd));
+ struct v4l2_async_subdev);
of_node_put(ep_node);
if (IS_ERR(asd)) {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
struct sensor_async_subdev *s_asd;
- struct v4l2_async_subdev *asd;
struct fwnode_handle *ep;
ep = fwnode_graph_get_endpoint_by_id(
if (ret)
goto err_parse;
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &cio2->notifier, ep, sizeof(*s_asd));
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ s_asd = v4l2_async_notifier_add_fwnode_remote_subdev(
+ &cio2->notifier, ep, struct sensor_async_subdev);
+ if (IS_ERR(s_asd)) {
+ ret = PTR_ERR(s_asd);
goto err_parse;
}
- s_asd = container_of(asd, struct sensor_async_subdev, asd);
s_asd->csi2.port = vep.base.port;
s_asd->csi2.lanes = vep.bus.mipi_csi2.num_data_lanes;
pdata->asd[i] = v4l2_async_notifier_add_fwnode_subdev(
&vpfe->notifier, of_fwnode_handle(rem),
- sizeof(struct v4l2_async_subdev));
+ struct v4l2_async_subdev);
of_node_put(rem);
if (IS_ERR(pdata->asd[i]))
goto cleanup;
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
&isi->notifier,
of_fwnode_handle(ep),
- sizeof(*asd));
+ struct v4l2_async_subdev);
of_node_put(ep);
if (IS_ERR(asd))
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
&subdev_entity->notifier,
of_fwnode_handle(subdev_entity->epn),
- sizeof(*asd));
+ struct v4l2_async_subdev);
of_node_put(subdev_entity->epn);
subdev_entity->epn = NULL;
v4l2_async_notifier_init(&csi2rx->notifier);
asd = v4l2_async_notifier_add_fwnode_remote_subdev(&csi2rx->notifier,
- fwh, sizeof(*asd));
+ fwh,
+ struct v4l2_async_subdev);
of_node_put(ep);
if (IS_ERR(asd))
return PTR_ERR(asd);
pdata->asd[i] = v4l2_async_notifier_add_fwnode_subdev(
&vpif_obj.notifier, of_fwnode_handle(rem),
- sizeof(struct v4l2_async_subdev));
+ struct v4l2_async_subdev);
if (IS_ERR(pdata->asd[i]))
goto err_cleanup;
}
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &fmd->subdev_notifier, of_fwnode_handle(ep), sizeof(*asd));
+ &fmd->subdev_notifier, of_fwnode_handle(ep),
+ struct v4l2_async_subdev);
of_node_put(ep);
asd = v4l2_async_notifier_add_i2c_subdev(&mcam->notifier,
i2c_adapter_id(cam->i2c_adapter),
ov7670_info.addr,
- sizeof(*asd));
+ struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
goto out_smbus_shutdown;
v4l2_async_notifier_init(&mcam->notifier);
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(&mcam->notifier,
- ep, sizeof(*asd));
+ asd = v4l2_async_notifier_add_fwnode_remote_subdev(&mcam->notifier, ep,
+ struct v4l2_async_subdev);
fwnode_handle_put(ep);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
{
struct fwnode_handle *ep;
struct isp_async_subdev *isd = NULL;
- struct v4l2_async_subdev *asd;
unsigned int i;
ep = fwnode_graph_get_endpoint_by_id(
ret = v4l2_fwnode_endpoint_parse(ep, &vep);
if (!ret) {
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &isp->notifier, ep, sizeof(*isd));
- if (!IS_ERR(asd)) {
- isd = container_of(asd, struct isp_async_subdev, asd);
+ isd = v4l2_async_notifier_add_fwnode_remote_subdev(
+ &isp->notifier, ep, struct isp_async_subdev);
+ if (!IS_ERR(isd))
isp_parse_of_parallel_endpoint(isp->dev, &vep, &isd->bus);
- }
}
fwnode_handle_put(ep);
}
if (!ret) {
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &isp->notifier, ep, sizeof(*isd));
-
- if (!IS_ERR(asd)) {
- isd = container_of(asd, struct isp_async_subdev, asd);
+ isd = v4l2_async_notifier_add_fwnode_remote_subdev(
+ &isp->notifier, ep, struct isp_async_subdev);
+ if (!IS_ERR(isd)) {
switch (vep.bus_type) {
case V4L2_MBUS_CSI2_DPHY:
isd->bus.interface =
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
&pcdev->notifier,
of_fwnode_handle(np),
- sizeof(*asd));
+ struct v4l2_async_subdev);
if (IS_ERR(asd))
err = PTR_ERR(asd);
out:
&pcdev->notifier,
pcdev->pdata->sensor_i2c_adapter_id,
pcdev->pdata->sensor_i2c_address,
- sizeof(*asd));
+ struct v4l2_async_subdev);
if (IS_ERR(asd))
err = PTR_ERR(asd);
} else if (pdev->dev.of_node) {
for_each_endpoint_of_node(dev->of_node, node) {
struct camss_async_subdev *csd;
- struct v4l2_async_subdev *asd;
if (!of_device_is_available(node))
continue;
goto err_cleanup;
}
- asd = v4l2_async_notifier_add_fwnode_subdev(
+ csd = v4l2_async_notifier_add_fwnode_subdev(
&camss->notifier, of_fwnode_handle(remote),
- sizeof(*csd));
+ struct camss_async_subdev);
of_node_put(remote);
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ if (IS_ERR(csd)) {
+ ret = PTR_ERR(csd);
goto err_cleanup;
}
- csd = container_of(asd, struct camss_async_subdev, asd);
-
ret = camss_of_parse_endpoint_node(dev, node, csd);
if (ret < 0)
goto err_cleanup;
}
asd = v4l2_async_notifier_add_fwnode_subdev(&vin->notifier, fwnode,
- sizeof(*asd));
+ struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
goto out;
}
asd = v4l2_async_notifier_add_fwnode_subdev(&vin->group->notifier,
- fwnode, sizeof(*asd));
+ fwnode,
+ struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
goto out;
priv->notifier.ops = &rcar_csi2_notify_ops;
asd = v4l2_async_notifier_add_fwnode_subdev(&priv->notifier, fwnode,
- sizeof(*asd));
+ struct v4l2_async_subdev);
fwnode_handle_put(fwnode);
if (IS_ERR(asd))
return PTR_ERR(asd);
}
asd = v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode,
- sizeof(*asd));
+ struct v4l2_async_subdev);
fwnode_handle_put(fwnode);
if (IS_ERR(asd))
return PTR_ERR(asd);
const struct ceu_platform_data *pdata)
{
const struct ceu_async_subdev *async_sd;
- struct v4l2_async_subdev *asd;
struct ceu_subdev *ceu_sd;
unsigned int i;
int ret;
/* Setup the ceu subdevice and the async subdevice. */
async_sd = &pdata->subdevs[i];
- asd = v4l2_async_notifier_add_i2c_subdev(&ceudev->notifier,
+ ceu_sd = v4l2_async_notifier_add_i2c_subdev(&ceudev->notifier,
async_sd->i2c_adapter_id,
async_sd->i2c_address,
- sizeof(*ceu_sd));
- if (IS_ERR(asd)) {
+ struct ceu_subdev);
+ if (IS_ERR(ceu_sd)) {
v4l2_async_notifier_cleanup(&ceudev->notifier);
- return PTR_ERR(asd);
+ return PTR_ERR(ceu_sd);
}
- ceu_sd = to_ceu_subdev(asd);
ceu_sd->mbus_flags = async_sd->flags;
ceudev->subdevs[i] = ceu_sd;
}
{
struct device_node *of = ceudev->dev->of_node;
struct device_node *ep;
- struct v4l2_async_subdev *asd;
struct ceu_subdev *ceu_sd;
unsigned int i;
int num_ep;
}
/* Setup the ceu subdevice and the async subdevice. */
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(
+ ceu_sd = v4l2_async_notifier_add_fwnode_remote_subdev(
&ceudev->notifier, of_fwnode_handle(ep),
- sizeof(*ceu_sd));
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ struct ceu_subdev);
+ if (IS_ERR(ceu_sd)) {
+ ret = PTR_ERR(ceu_sd);
goto error_cleanup;
}
- ceu_sd = to_ceu_subdev(asd);
ceu_sd->mbus_flags = fw_ep.bus.parallel.flags;
ceudev->subdevs[i] = ceu_sd;
struct v4l2_fwnode_endpoint vep = {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
- struct rkisp1_sensor_async *rk_asd = NULL;
- struct v4l2_async_subdev *asd;
+ struct rkisp1_sensor_async *rk_asd;
struct fwnode_handle *ep;
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(rkisp1->dev),
if (ret)
goto err_parse;
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(ntf, ep,
- sizeof(*rk_asd));
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ rk_asd = v4l2_async_notifier_add_fwnode_remote_subdev(ntf, ep,
+ struct rkisp1_sensor_async);
+ if (IS_ERR(rk_asd)) {
+ ret = PTR_ERR(rk_asd);
goto err_parse;
}
- rk_asd = container_of(asd, struct rkisp1_sensor_async, asd);
rk_asd->mbus_type = vep.bus_type;
rk_asd->mbus_flags = vep.bus.mipi_csi2.flags;
rk_asd->lanes = vep.bus.mipi_csi2.num_data_lanes;
v4l2_async_notifier_init(&dcmi->notifier);
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &dcmi->notifier, of_fwnode_handle(ep), sizeof(*asd));
+ &dcmi->notifier, of_fwnode_handle(ep),
+ struct v4l2_async_subdev);
of_node_put(ep);
csi->bus = vep.bus.parallel;
- asd = v4l2_async_notifier_add_fwnode_remote_subdev(&csi->notifier,
- ep, sizeof(*asd));
+ asd = v4l2_async_notifier_add_fwnode_remote_subdev(&csi->notifier, ep,
+ struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
goto out;
for (i = 0; i < cal->data->num_csi2_phy; ++i) {
struct cal_camerarx *phy = cal->phy[i];
struct cal_v4l2_async_subdev *casd;
- struct v4l2_async_subdev *asd;
struct fwnode_handle *fwnode;
if (!phy->sensor_node)
continue;
fwnode = of_fwnode_handle(phy->sensor_node);
- asd = v4l2_async_notifier_add_fwnode_subdev(&cal->notifier,
- fwnode,
- sizeof(*casd));
- if (IS_ERR(asd)) {
+ casd = v4l2_async_notifier_add_fwnode_subdev(&cal->notifier,
+ fwnode,
+ struct cal_v4l2_async_subdev);
+ if (IS_ERR(casd)) {
phy_err(phy, "Failed to add subdev to notifier\n");
- ret = PTR_ERR(asd);
+ ret = PTR_ERR(casd);
goto error;
}
- casd = to_cal_asd(asd);
casd->phy = phy;
}
continue;
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &vmux->notifier, ep, sizeof(*asd));
+ &vmux->notifier, ep, struct v4l2_async_subdev);
fwnode_handle_put(ep);
dev_dbg(xdev->dev, "parsing node %p\n", fwnode);
while (1) {
- struct v4l2_async_subdev *asd;
+ struct xvip_graph_entity *xge;
ep = fwnode_graph_get_next_endpoint(fwnode, ep);
if (ep == NULL)
continue;
}
- asd = v4l2_async_notifier_add_fwnode_subdev(
+ xge = v4l2_async_notifier_add_fwnode_subdev(
&xdev->notifier, remote,
- sizeof(struct xvip_graph_entity));
+ struct xvip_graph_entity);
fwnode_handle_put(remote);
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ if (IS_ERR(xge)) {
+ ret = PTR_ERR(xge);
goto err_notifier_cleanup;
}
}
EXPORT_SYMBOL_GPL(__v4l2_async_notifier_add_subdev);
struct v4l2_async_subdev *
-v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
- struct fwnode_handle *fwnode,
- unsigned int asd_struct_size)
+__v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
+ struct fwnode_handle *fwnode,
+ unsigned int asd_struct_size)
{
struct v4l2_async_subdev *asd;
int ret;
return asd;
}
-EXPORT_SYMBOL_GPL(v4l2_async_notifier_add_fwnode_subdev);
+EXPORT_SYMBOL_GPL(__v4l2_async_notifier_add_fwnode_subdev);
struct v4l2_async_subdev *
-v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
- struct fwnode_handle *endpoint,
- unsigned int asd_struct_size)
+__v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
+ struct fwnode_handle *endpoint,
+ unsigned int asd_struct_size)
{
struct v4l2_async_subdev *asd;
struct fwnode_handle *remote;
if (!remote)
return ERR_PTR(-ENOTCONN);
- asd = v4l2_async_notifier_add_fwnode_subdev(notif, remote,
- asd_struct_size);
+ asd = __v4l2_async_notifier_add_fwnode_subdev(notif, remote,
+ asd_struct_size);
/*
- * Calling v4l2_async_notifier_add_fwnode_subdev grabs a refcount,
+ * Calling __v4l2_async_notifier_add_fwnode_subdev grabs a refcount,
* so drop the one we got in fwnode_graph_get_remote_port_parent.
*/
fwnode_handle_put(remote);
return asd;
}
-EXPORT_SYMBOL_GPL(v4l2_async_notifier_add_fwnode_remote_subdev);
+EXPORT_SYMBOL_GPL(__v4l2_async_notifier_add_fwnode_remote_subdev);
struct v4l2_async_subdev *
-v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
- int adapter_id, unsigned short address,
- unsigned int asd_struct_size)
+__v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
+ int adapter_id, unsigned short address,
+ unsigned int asd_struct_size)
{
struct v4l2_async_subdev *asd;
int ret;
return asd;
}
-EXPORT_SYMBOL_GPL(v4l2_async_notifier_add_i2c_subdev);
+EXPORT_SYMBOL_GPL(__v4l2_async_notifier_add_i2c_subdev);
int v4l2_async_register_subdev(struct v4l2_subdev *sd)
{
asd = v4l2_async_notifier_add_fwnode_subdev(notifier,
args.fwnode,
- sizeof(*asd));
+ struct v4l2_async_subdev);
fwnode_handle_put(args.fwnode);
if (IS_ERR(asd)) {
/* not an error if asd already exists */
struct v4l2_async_subdev *asd;
asd = v4l2_async_notifier_add_fwnode_subdev(notifier, fwnode,
- sizeof(*asd));
+ struct v4l2_async_subdev);
fwnode_handle_put(fwnode);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
FWNODE_GRAPH_ENDPOINT_NEXT);
if (ep) {
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &priv->notifier, ep, sizeof(*asd));
+ &priv->notifier, ep, struct v4l2_async_subdev);
fwnode_handle_put(ep);
/* add CSI fwnode to async notifier */
asd = v4l2_async_notifier_add_fwnode_subdev(&imxmd->notifier,
of_fwnode_handle(csi_np),
- sizeof(*asd));
+ struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
if (ret == -EEXIST)
dev_dbg(csi2->dev, "flags: 0x%08x\n", vep.bus.mipi_csi2.flags);
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &csi2->notifier, ep, sizeof(*asd));
+ &csi2->notifier, ep, struct v4l2_async_subdev);
fwnode_handle_put(ep);
if (IS_ERR(asd))
FWNODE_GRAPH_ENDPOINT_NEXT);
if (ep) {
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &csi->notifier, ep, sizeof(*asd));
+ &csi->notifier, ep, struct v4l2_async_subdev);
fwnode_handle_put(ep);
dev_dbg(state->dev, "flags: 0x%08x\n", state->bus.flags);
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
- &state->notifier, ep, sizeof(*asd));
+ &state->notifier, ep, struct v4l2_async_subdev);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
goto err_parse;
struct tegra_vi *vi = chan->vi;
struct fwnode_handle *ep = NULL;
struct fwnode_handle *remote = NULL;
- struct v4l2_async_subdev *asd;
+ struct tegra_vi_graph_entity *tvge;
struct device_node *node = NULL;
int ret;
continue;
}
- asd = v4l2_async_notifier_add_fwnode_subdev(&chan->notifier,
- remote, sizeof(struct tegra_vi_graph_entity));
- if (IS_ERR(asd)) {
- ret = PTR_ERR(asd);
+ tvge = v4l2_async_notifier_add_fwnode_subdev(&chan->notifier,
+ remote, struct tegra_vi_graph_entity);
+ if (IS_ERR(tvge)) {
+ ret = PTR_ERR(tvge);
dev_err(vi->dev,
"failed to add subdev to notifier: %d\n", ret);
fwnode_handle_put(remote);
* is released later at notifier cleanup time.
*/
struct v4l2_async_subdev *
-v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
- struct fwnode_handle *fwnode,
- unsigned int asd_struct_size);
+__v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
+ struct fwnode_handle *fwnode,
+ unsigned int asd_struct_size);
+#define v4l2_async_notifier_add_fwnode_subdev(__notifier, __fwnode, __type) \
+((__type *)__v4l2_async_notifier_add_fwnode_subdev(__notifier, __fwnode, \
+ sizeof(__type)))
/**
* v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
* exception that the fwnode refers to a local endpoint, not the remote one.
*/
struct v4l2_async_subdev *
-v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
- struct fwnode_handle *endpoint,
- unsigned int asd_struct_size);
+__v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
+ struct fwnode_handle *endpoint,
+ unsigned int asd_struct_size);
+#define v4l2_async_notifier_add_fwnode_remote_subdev(__notifier, __ep, __type) \
+((__type *)__v4l2_async_notifier_add_fwnode_remote_subdev(__notifier, __ep, \
+ sizeof(__type)))
/**
* v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
* Same as above but for I2C matched sub-devices.
*/
struct v4l2_async_subdev *
-v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
- int adapter_id, unsigned short address,
- unsigned int asd_struct_size);
+__v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
+ int adapter_id, unsigned short address,
+ unsigned int asd_struct_size);
+#define v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, __type) \
+((__type *)__v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, \
+ sizeof(__type)))
/**
* v4l2_async_notifier_register - registers a subdevice asynchronous notifier