node-drivers/base-driver/drivers/vca/plx87xx/plx_main.c
static inline int _validate_ptr(struct plx_device* xdev, void** ptr, const char* name)
{
	int rc = 0;
	if (IS_ERR_OR_NULL(*ptr)) {
		if (!(*ptr)) {
			rc = -ENODEV;
			dev_err(&xdev->pdev->dev, "failed to register %s device\n", name);
		} else {
			rc = PTR_ERR(*ptr);
			dev_err(&xdev->pdev->dev, "failed to register %s device, rc=%d\n", name, rc);
		}
		*ptr = NULL;
	}
	return rc;
}
/* helper function to check if pointer is NULL or error. In such case pointer is set to NULL,
 * error is logged and error code is returned. If pointer looks good nothing happens and function
 * returns with 0 */
helper function to check if pointer is NULL or error. In such case pointer is set to NULL,
error is logged and error code is returned. If pointer looks good nothing happens and function
returns with 0
helper function to check if pointer is NULL or error . In such case pointer is set to NULL error is logged and error code is returned . If pointer looks good nothing happens and function returns with 0
static inline int _validate_ptr(struct plx_device* xdev, void** ptr, const char* name)
{
	int rc = 0;
	if (IS_ERR_OR_NULL(*ptr)) {
		if (!(*ptr)) {
			rc = -ENODEV;
			dev_err(&xdev->pdev->dev, "failed to register %s device\n", name);
		} else {
			rc = PTR_ERR(*ptr);
			dev_err(&xdev->pdev->dev, "failed to register %s device, rc=%d\n", name, rc);
		}
		*ptr = NULL;
	}
	return rc;
}
static inline int _validate_ptr ( struct plx_device * xdev , void * * ptr , const char * name ) { int rc = 0 ; if ( IS_ERR_OR_NULL ( * ptr ) ) { if ( ! ( * ptr ) ) { rc = - ENODEV ; dev_err ( & xdev -> pdev -> dev , " \n " , name ) ; } else { rc = PTR_ERR ( * ptr ) ; dev_err ( & xdev -> pdev -> dev , " \n " , name , rc ) ; } * ptr = NULL ; } return rc ; }
helper function to check if pointer is NULL or error.
helper function to check if pointer is NULL or error .